adsense

Hii, welcome to my site. My name is Om prakash kartik. This blog helps you to learn programming languages concepts.

program in c++ to function return multiple value

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();
   }

Output:-


output




output


Post a Comment

0 Comments