Tuesday, 26 March 2019

CP : Function 2 ( sum using function )

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: 



No comments:

Post a Comment

LAB 7 Arduino with Seven Segment Display || Arduino Tutorial || Code and Circuit Diagram || Project

  LAB 7 Arduino with Seven Segment Display || Arduino Tutorial || Code and Circuit Diagram || Project Dear All We will learn how to Connec...