Q:

Find largest number between two numbers using c++

0

Write a program to enter two numbers and print the largest number

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

#include <iostream>
using namespace std;
int main(){
long int A,B,max;
cout<<"enter the first number:";
cin>>A;
cout<<"enter the second number:";
cin>>B;
max=A;
if (max<B)
max=B;
cout<<"Maximum="<<max<<endl;
}

 

Output:

enter the first number:3
enter the second number:8
Maximum=8

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now