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 basic if statement syntax?
What is encapsulation in ict?
Can we provide one default constructor for our class?
How to delete array of objects in C++? Proof by C++ code for proper deletion
Explain polymorphism?
What is the difference between strcpy() and strncpy()?
Does c++ have finally?
We all know that a const variable needs to be initialized at the time of declaration. Then how come the program given below runs properly even when we have not initialized p?
What is private, public and protected inheritance?
What is a character in c++?
Difference between delete and free.
What is latest update of C++ ?
What is polymorphism and example?
What is data binding in c++?
Arrange Doubly linked list in the ascending order of its integral value and replace integer 5 with 7?