Write a program of function with no parameter and but return value


 

/* Write a program of function with no parameter and but return value. */

#include<iostream.h>

#include<conio.h>

main()

{

int a,b,c;

int sum();

clrscr();

c=sum();

cout<<c;

getch();

}

int sum()

{

int a,b,c;

cout<<“enter value a=”;

cin>>a;

cout<<“enter value b=”;

cin>>b;

c=a+b;

return(c);

}

output:

enter value a=8

enter value b=9

17

Related Posts

Comments are closed.