Function Program21

//With return value, with argument .. addition of two number


#include<stdio.h>

#include<conio.h>


int sum(int, int);


void main()

{

int a, b, c;

clrscr();


printf("\nEnter number1: ");

scanf("%d", &a);


printf("\nEnter number2: ");

scanf("%d", &b);


c = sum(a, b);

printf("\n\nSum is %d", c);


getch();

}


int sum(int x, int y)

{

return x+y;

}

No comments:

Post a Comment