Computer Science, asked by syedmdsaif827, 1 year ago

write a c++program to find largest two numbers

Answers

Answered by AdrijaS
0

The program will be as follows:

#include <iostream>

using namespace std;

int main()

{

   int num1, num2;

   cout<<"Enter first number:";  

   cin>>num1;

   cout<<"Enter second number:";  

   cin>>num2;

   if(num1>num2)

   {

cout<<"First number "<<num1<<" is the largest";

   }

   else

   {

cout<<"Second number "<<num2<<" is the largest";

   }

   return 0;

}



The output will be as follows: (based upon your input; I just have given an example)

Enter first number : 75

Enter second number : 98

Second number 98 is the largest.

Answered by Soñador
0

Answer:

#include<constream.h>

void main()

{

clrscr();

int a, b;

cout<<"\n Enter first number :";

cin>>a;

cout<<"\n Enter second number :";

cin>>b;

cout<<"\n Largest number=";

if(a>b)

{

cout<<a;

}

else

{

cout<<b;

}

getch();

}

Similar questions