Advertisement
Guest User

Untitled

a guest
Nov 15th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.69 KB | None | 0 0
  1. int arrlength;
  2.             while (numvalidation == false)
  3.             {
  4.                 printf("Enter array length: ");
  5.                 scanf("%d", &arrlength);
  6.                 // checking the input. if the input is lower than zero, directing to entering array length
  7.                 if (arrlength <= 0)
  8.                 {
  9.                     puts("Wrong input, try again");
  10.                     numvalidation = false;
  11.                 }
  12.                 else
  13.                 {
  14.                     numvalidation = true;
  15.                 }
  16.             }
  17.             float array[arrlength];
  18.             for (int i = 0; i < arrlength; i++)
  19.             {
  20.                 array[i] = 0;
  21.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement