View Code of Problem 1

#include<stdio.h>
void main(){
  int a,int b;
  scanf("%d %d",&a,&b);
  printf("%d",a+b);

}
/*
Main.c:2:6: warning: return type of 'main' is not 'int' [-Wmain]
 void main(){
      ^
Main.c: In function 'main':
Main.c:3:9: error: expected identifier or '(' before 'int'
   int a,int b;
         ^
Main.c:4:21: error: 'b' undeclared (first use in this function)
   scanf("%d %d",&a,&b);
                     ^
Main.c:4:21: note: each undeclared identifier is reported only once for each function it appears in
*/

Double click to view unformatted code.


Back to problem 1