C++ Programming Blog

 
 
 

Image

 #include<iostream.h>
 #include<conio.h>

 void largest(int,int,int);

 main()
    {
       clrscr();


       int value_1;
       int value_2;
       int value_3;

       cout<<\"\\n Enter the value_1 =  \";
       cin>>value_1;

       cout<<\"\\n Enter the value_2 =  \";
       cin>>value_2;

       cout<<\"\\n Enter the value_3 =  \";
       cin>>value_3;

       largest(value_1,value_2,value_3);

       getch();
       return 0;
    }



 //-------------------------  largest(int,int,int)  ----------------------//


 void largest(int x,int y,int z)
    {
       int largest=x;

       if(y>largest)
      largest=y;

       if(z>largest)
      largest=z;

       cout<<\"\\n Largest integer is = \"<<largest<<endl;
    }