I just installed Eclipse for C ++ and I had a problem with the printf() function. My code should start by typing: βGive the number,β but that is not the case. If I type 4, this is what I get:
4
Give the number:
I am number 1
I am number 2
I am number 3
I am number 4
#include <stdio.h> #include <stdlib.h> int main(void) { int n=0,i; printf("Give the number:\n"); scanf("%d", &n); for(i=1;i<=n;i++) printf("I am number %d\n",i); return EXIT_SUCCESS; }
source share