A C program to create a user defined function to display the sum of any 2 numbers

//A C program to create a user defined function to display the sum of any 2 numbers.

#include<stdio.h> 
#include<conio.h>
int sum(int,int); 
void main() 
{clrscr();
int a,b,c; 
printf(“\nEnter first number”);
scanf("%d", &a);
printf(“\nEnter second number”);
scanf("%d", &b);
c = sum(a, b); 
printf ("sum is = %d\n", c); getch();
}int sum(int a, int b)
{int c;
c=a+b;
return(c);
}

Output:


A C program to create a user defined function to display the sum of any 2 numbers, my knowledge to you dude, write A C program to create a user defined function to display the sum of any 2 numbers, wap to create a user defined function to display the sum of any 2 numbers, user define function, sum of two numbers

Post a Comment

0 Comments