Header Ads Widget

Ticker

6/recent/ticker-posts

functions program in c :- 5

 Program 5: Design a function sum, which takes two integer values inside the body of sum function and make addition and dose not return addition to calling function. But sum function itself print addition inside the body of sum function. (C function without arguments and without return type)


#include< stdio.h >

#include< conio.h >

void main ()

{

int c;

void sum (void);

sum ();

getch();

}

void sum (void)

{

int a, b;

printf(“\n Enter two number ”);

scanf(“%d %d ”& a, &b);

c=a + b;

printf(“\n Addition is =%d ”,c);

}


Output:

Enter two number

21

31

Addition is =52

Post a Comment

0 Comments