#include <stdio.h>
int main (void) {
int t;
int y, z, a, b;
scanf ("%i", &t);
for (t; t > 0 {
scanf ("%i", &y);
βt;
}
return 0;
}
The above code works fine and the program ends after I input t
integers. But I want the program to allow me to enter larger positive integers, so I modified the code to this :
#include <stdio.h>
int main (void) {
unsigned long long int t;
int y, z, a, b;
scanf ("%llu", &t);
for (t; t > 0 ;) {
scanf ("%i", &y);
--t;
}
return 0;
}
According to the code, if I enter 5
, it should then allo me to enter 5 more integers, but instead I can enter as amny integers as I want. It seems that the for
loop is not ending. Donβt know why.