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 find the greatest number among four given numbers using function

Program in C++ to find the greatest number among four given numbers  using function


#include<iostream>
#include<conio.h>
 using namespace std;
 int Greater(int a,int b,int c,int d)
  {
   if(a>b&&a>c&&a>d)
     return a;
   else if(b>c&&b>d)
     return b;
   else if(c>d)
     return c;
   else
      return d;
   }
 int main()
  {
   int j,k,l,m;
   cout<<"Enter 4 nos.:-",
   cin>>j>>k>>l>>m;
   int r=Greater(j,k,l,m);
   cout<<r<<" is greater.";
   getch();
   return 0;
   }
Output:-






Post a Comment

0 Comments