Write a program to read two numbers from the keyboard and display the larger value on the screen
#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
float a,b;
cout<<" Enter two values :"<<endl;
cin>>a>>b;
if(a>b)
cout<<" larger value = "<<a<<endl;
else
cout<<" larger value = "<<b<<endl;
return 0;
}
OUTPUT:
Enter two values:10 20
Larger value:20
| Is This Answer Correct ? | 2 Yes | 0 No |
How to generate random numbers in C++ with a range?
Is there a difference between class and struct?
Write a C++ Program to Check Whether a character is Vowel or Consonant.
What is pass by value & reference.
Write a C++ Program to find Addition of Two Numbers.
How will you print a list of all unique words from a string which may contain repeated words?
What is C++11?
In C++ what is the meaning of data hiding?
When would you choose to return an error code rather than throw an exception?
Is deconstructor overloading possible? If yes then explain and if no Then why?
Do you know about Agilent PRECOMPILERS. ?
What are the major differences between C and C++?