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
How do I convert a stl file?
What would happen on forgetting [], while deallocating an array through new?
Write a program in c++ to print the numbers from n to n2 except 5 and its multiples
What is class and object with example?
Write a program to concatenate two strings.
Describe friend function & its advantages.
What is encapsulation in c++ with example?
What happens when you make call 'delete this;'?
What are the fundamental features of an object-oriented language?
What are maps in c++?
Can private class be inherited?
What are the important differences between c++ and java?
Explain why C++ is not purely Object Oriented Language
Does c++ have foreach?
What is heap sort in c++?