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)

Calculate the square root of a number using c++... >>
<< Calculate a students average in ten subjects using...