Write a program to read two numbers from the keyboard and display the larger value on the screen

Answer Posted / hr

#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 ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

When should overload new operator on a global basis or a class basis?

694


What is c++ and its uses?

720


What is the return value of the insertion operator?

713


Explain the extern storage classes in c++.

644


What is #include iostream in c++?

673






Do we have to use initialization list in spite of the assignment in constructors?

670


Can c++ be faster than c?

691


Why are pointers not used in c++?

711


What is the best it certification?

700


What are the two shift operators and what are their functions?

665


Is vector a class in c++?

689


What are string library functions(syntax).

626


Explain virtual class and friend class.

687


What is ostream in c++?

652


What is the full form of india?

665