Computer Science, asked by ad19052002, 1 year ago

Program to find maximum of 2 numbers in C++

Answers

Answered by aryandeshmukh9pd4kzl
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
aryandeshmukh9pd4kzl: no problem
Answered by HeArty
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();

ad19052002: thanks
HeArty: it's OK ay
Similar questions