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 ? | 2 Yes | 0 No |
Post New Answer View All Answers
What is multilevel inheritance explain with example?
What is the benefit of encapsulation?
What is a type library?
In C++ what is a vtable and how does it work?
Define 'std'.
What is the use of setprecision in c++?
What is polymorphism give a real life example?
What is the difference between public, private, and protected inheritance?
What is the use of default constructor?
What are the implicit member functions of class?
How to stop class inheritance in C++ with condition that object creation should be allowed
What are the various situations where a copy constructor is invoked?
What is a storage class?
What is the difference between public and private data members?
If we want that any wildcard characters in the command line arguments should be appropriately expanded, are we required to make any special provision? If yes, which?