Function Program18

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


#include<stdio.h>

#include<conio.h>


int sum();


void main()

{

int c;

clrscr();

c = sum();


printf("\nSum = %d", c);

getch();

}


int sum()

{

int a, b, c;


printf("\nEnter value of A: ");

scanf("%d", &a);


printf("\nEnter value of B: ");

scanf("%d", &b);


c = a + b;


return c;

}

No comments:

Post a Comment