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
Is there a difference between class and struct?
What is c++ virtual inheritance?
What are friend classes?
How to improve object oriented design skills?
When do we run a shell in the unix system?
What is the main use of c++?
What is the use of endl in c++ give an example?
Discussion on error handling of C++ .
What is a class in C++?
Differentiate between a constructor and a method in C++.
What is the advantage of c++ over c?
What does h mean in maths?
Write a program to implement OOPS concepts such as inheritance, polymorphism, friend function, operator overloading?
Keyword mean in declaration?
Why is encapsulation used?