Home > Net >  How can I load and then print multiple numbers if their quantity is determinted by the input and not
How can I load and then print multiple numbers if their quantity is determinted by the input and not

Time:10-29

enter image description here

how can I do this using scanf funtion ranging form -1000 to 1000 ? just %d numbers

CodePudding user response:

Try dooing a loop with a scanf and a printf inside, like this:

int num = 0;
for(int i = 0; i < 5; i  ){
   scanf("%d", &num);
   printf("%d", num);
}

You just need to change the 5 to the number of iterations you need.

  •  Tags:  
  • c
  • Related