Program in C++ to Function return multiple value
#include<iostream> #include<conio.h> using namespace std; void Fun(int a,int b,int &add,int &sub,int &mul,int &div) { add=a+b; sub=a-b; mul=a*b; div=a/b; } int main() { int a,s,m,d; Fun(3,5,a,s,m,d); cout<<"Sum ="<<a<<endl; cout<<"Sub ="<<s<<endl; cout<<"Mul ="<<m<<endl; cout<<"Div ="<<d<<endl; getch(); }
0 Comments