C++, Programmimg Languages

Write a program in C++ to find the greatest of 3 no.’s using nested if else statement

​#include<iostream.h>

#include<conio.h>

main()

{

int x,y,z;

cout<<“Enter any three numbers”;

cin>>x>>y>>z;

if(x>y && x>z)

cout<<“x is greater”;

else

if(y>x &&y>z)

cout<<“y is greater”;

else

if(z>x &&z>y)

cout<<“z is greater “;

getch();

}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s