Write a program to sum of two numbers with user defind function.


 

 

/* Write a program to sum of two numbers with user defind function. */

#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

void sum(void);

sum();

getch();

}

void sum()

{

int a,b,c;

cout<<“enter value a”;

cin>>a;

cout<<“enter value b”;

cin>>b;

c=a+b;

cout<<“c=”<<c;

}

output:

enter value a=6

enter value b=8

c=14

Related Posts

Comments are closed.