0

Why program needs 2-time use input if we put \n after %d on the Scanf line????

'''
#include<stdio.h>

int main(){
int i=1;
int n;
printf("Enter the value of n\n");
scanf("%d\n",&n);
do{
    printf("The %d natural number is: %d\n",i, i);
    i++;
}
while(i<=n);
return 0;
}
'''
marc_s
  • 704,970
  • 168
  • 1,303
  • 1,425

0 Answers0