Can you please write any user defined program in c.
Answers
Answered by
1
Answer:
#include <stdio.h>
int addNumbers(int a, int b); // function prototype
int main()
{
int n1,n2,sum;
printf("Enters two numbers: ");
scanf("%d %d",&n1,&n2);
sum = addNumbers(n1, n2); // function call
printf("sum = %d",sum);
return 0;
}
int addNumbers(int a, int b) // function definition
{
int result;
result = a+b;
return result; // return statement
}
Explanation:
hope it helps u
:)
Similar questions
Math,
4 months ago
Math,
4 months ago
Physics,
4 months ago
Science,
9 months ago
Business Studies,
1 year ago