Program to find maximum of 2 numbers in C++
Answers
Answered by
1
#include<iostream.h>
void main()
{
int x=3,y=4
if(x>y)
cout<<"x is greater than y"<<endl;
else
cout<<"x is smaller than y"<<endl;
}
ad19052002:
thanks
Answered by
2
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int a,b;
cout<<"Enter two no\n";
cin>>a,b;
if(a>b)? a:b
{
cout<<"the max no is a ";
}
else
{
cout<<"max no is b";
}
getch();
#include<conio.h>
void main()
{
clrscr();
int a,b;
cout<<"Enter two no\n";
cin>>a,b;
if(a>b)? a:b
{
cout<<"the max no is a ";
}
else
{
cout<<"max no is b";
}
getch();
Similar questions
Computer Science,
7 months ago
Biology,
7 months ago
Physics,
1 year ago
Math,
1 year ago
Social Sciences,
1 year ago