PROGRAM1.C -
#include<stdio.h>
int main()
{
int vari, var2;
printf("Enter number 1: ");
scanf("%d",&var1);
printf("Enter number 2: ");
scnaf ("d",&var2);
int res = addition (vari, var2);
printf ("Output: %d", res);
return 0;
}
int addition(int numi, int num2)
Message
Compiling PROGRAM1.C:
-Error PROGRAM1.C 10: Declaration is not allowed here
Answers
Answered by
0
Answer:
#include<stdio.h>
int addition(int num1, int num2)
{
return num1+num2;
}
int main()
{
int var1, var2;
printf("Enter number 1: ");
scanf("%d",&var1);
printf("Enter number 2: ");
scanf ("%d",&var2);
int res = addition (var1, var2);
printf ("Output: %d", res);
return 0;
}
Similar questions
Social Sciences,
2 months ago
Physics,
2 months ago
English,
2 months ago
Accountancy,
4 months ago
Biology,
10 months ago
English,
10 months ago