Write a program to read two numbers from the keyboard and display the larger value on the screen
#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 |
What is placement new?
How does free know the size of memory to be deleted
Explain the importance of method overloading in C++?
0 Answers Akamai Technologies, Infogain,
Tell us the size of a float variable.
Difference between Call by pointer and by reference.
What is the difference between an ARRAY and a LIST in C++?
What Is Polymorphism in C++ ?
2 Answers IBS, Impetus, ITC Indian Tobacco Company, Motorola,
explain the term 'resource acquisition is initialization'?
What are the advantages/disadvantages of using inline and const?
How to input string in C++
Factory Method C++ – How to delete pointers returned by it
what is friend function in C++?