adsense

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

Write a program in C++ to find greatest among 4 numbers.

Write a program in C++ to find greatest among 4 numbers.

#include<iostream.h>
#include<conio.h>
 void main()
  {
   int a,b,c,d;
   clrscr();
   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.";
   getch();
   }
Output:-

Post a Comment

0 Comments