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

What is cohesion in oop?

621


Is C++ case sensitive a) False b) Depends on implementation c) True

612


What is type of 'this' pointer?

596


What is jump statement in C++?

615


What are oops methods?

566






Is java as fast as c++?

597


What are keywords in c++?

598


What do you mean by public protected and private in c++?

600


What is the use of 'using' declaration in c++?

623


Why would you use pointers in c++?

623


What is the best way to declare and define global variables?

695


Can member data be public?

597


Can a new be used in place of old mallocq? If yes, why?

633


Why is it so that we can have virtual constructors but we cannot have virtual destructors?

3825


What are dynamic type checking?

614