Write a program in C++ to print the greatest number among two values.
Answers
Answered by
0
Answer:
Explanation:
#include<iostream.h>
void main()
{
int a,b;
cout<<"enter first and second value<<endl;
cin>>a,b;
if(a > b)
{
cout<<"a is greater"<<endl;
}
else
{
cout<<"b is greater"<<endl;
}
}
Answered by
31
Answer:
The program is as follows:
#include<iostream.h>
#include<conio.h>
Void main()
{
int x , y;
cout<<"Enter the two number which are to be compared";
cin>>x;
cin>>y;
if (x>y)
{
cout<<"x is the greater number";
}
else
{
cout<<"y is the greater number";
}
getch();
}
Extra info:
- C++ language was developed at AT&t bell laboratory in the 1980's by BJARNE STROUSTRUP.
- it was originally called "c with classes".
- the name C++ was coined by RICH MASCITLI where ++ is the C increment operator.
- the maturation of C++ language is attested to recent events especially formation of american national standard institute (ANSI)
- the publications of C++ reference manuals was done by ellis and stroustrup.
Similar questions