Que: Summation using the function
Code:
#include<stdio.h>
int main()
{
int num1, num2, res;
printf("\nEnter the two numbers : \n");
scanf("%d %d", &num1, &num2);
//Call Function Sum With Two Parameters
res = sum(num1, num2);
printf("nAddition of two number is : %d \n",res);
return (0);
}
int sum(num1, num2)
{
int num3;
num3 = num1 + num2;
return (num3);
}
Output:
Code:
#include<stdio.h>
int main()
{
int num1, num2, res;
printf("\nEnter the two numbers : \n");
scanf("%d %d", &num1, &num2);
//Call Function Sum With Two Parameters
res = sum(num1, num2);
printf("nAddition of two number is : %d \n",res);
return (0);
}
int sum(num1, num2)
{
int num3;
num3 = num1 + num2;
return (num3);
}
Output:
No comments:
Post a Comment