Computer Science, asked by seervivanitha, 4 months ago

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 codecracker
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