View Code of Problem 1

int main(void)
{
	int a,b;
	while(scanf("%d%d",&a,&b)!=EOF)
	printf("%d\n",a+b);
  	return 0;
}
/*
Main.c: In function 'main':
Main.c:4:8: warning: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
  while(scanf("%d%d",&a,&b)!=EOF)
        ^~~~~
Main.c:4:8: warning: incompatible implicit declaration of built-in function 'scanf'
Main.c:4:8: note: include '<stdio.h>' or provide a declaration of 'scanf'
Main.c:1:1:
+#include <stdio.h>
 int main(void)
Main.c:4:8:
  while(scanf("%d%d",&a,&b)!=EOF)
        ^~~~~
Main.c:4:29: error: 'EOF' undeclared (first use in this function)
  while(scanf("%d%d",&a,&b)!=EOF)
                             ^~~
Main.c:4:29: note: 'EOF' is defined in header '<stdio.h>'; did you forget to '#include <stdio.h>'?
Main.c:4:29: note: each undeclared identifier is reported only once for each function it appears in
Main.c:5:2: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
  printf("%d\n",a+b);
  ^~~~~~
Main.c:5:2: warning: incompatible implicit declaration of built-in function 'printf'
Main.c:5:2: note: include '<stdio.h>' or provide a declaration of 'printf'
*/

Double click to view unformatted code.


Back to problem 1