0 votes
1.3k views
in Programming by (98.9k points)
edited
Write a program in C++, to find max of two numbers using if else control structure.

1 Answer

0 votes
by (98.9k points)
selected by
 
Best answer
#include<iostream>
using namespace std;
int main()
{
    int num1, num2, max_no;
    cout<<"Enter the Two Numbers: ";
    cin>>num1>>num2;
    if(num1>num2)
        max_no = num1;
    else
        max_no = num2;
    cout<<"\nMaximum of two nos is = "<<max_no;
    cout<<endl;
    return 0;
}

output::
image

Related questions

0 votes
1 answer 148 views

Doubtly is an online community for engineering students, offering:

  • Free viva questions PDFs
  • Previous year question papers (PYQs)
  • Academic doubt solutions
  • Expert-guided solutions

Get the pro version for free by logging in!

5.7k questions

5.1k answers

108 comments

561 users

...