START02 Help

QUESTION LINK CodeChef: Practical coding for everyone

MY CODE

#include<stdio.h>
int main()
{
int a;
while(scanf(“%d”,&a)!=0)
{
printf(“%d”,a);
}
return 0;
}

use eof rather than 0.

1 Like

Print a newline after each output.

1 Like

IF I USE EOF THEN A COMPILE TIME ERROR OCCUR :

prog.cpp: In function ‘int main()’:
prog.cpp:5:27: error: ‘eof’ was not declared in this scope
while(scanf("%d",&a)!=eof)

try while(scanf("%d",&a)==1)

or
try EOF

Use “long long int a;”

And Try while(scanf("%lld",&a)==1)