c - Counter within a if-statement will not print whats needed -
i'm working create set of values below 1000 , subset them according number size, , count how many in set. counter part not print statement. in advance.
#include <stdio.h> #include <stdlib.h> #include <math.h> int n; int arraysize; int randn; int rand(); int countone = 0; int counttwo = 0; int countthree = 0; int countfour = 0; int countfive = 0; int main() { printf("what size of array\n"); scanf("%d", &n); int array[n]; int i; (i = 0 ; < n; i++ ) { randn=rand() % 999; array[i]=randn; } (i = 0 ; < n; i++ ) { printf("%i\n", array[i]); } //the issue starts below here if(0>=array[i] && array[i] <= 199){ for(i = 0 ; < n ; i++){ countone++; printf("%d", countone); } } }
Comments
Post a Comment