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

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


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




Post a Comment

0 Comments