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 ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are static variables?

619


Of the numbers 12 23 9 28 which would be at the top of a properly implemented maxheap a) 28 b) 9 c) Any of them could be

934


What is else if syntax?

681


Can non-public members of another instance of the class be retrieved by the method of the same class?

610


Explain the isa and hasa class relationships. How would you implement each?

617






What is the full form of stl in c++?

683


Explain all the C++ concepts using examples.

686


Write a Program for dynamically intialize a 2 dimentional array. Eg:5x20, accept strings and check for vowels and display the no.finally free the space allocated .

688


What are the advantages of pointers?

602


Which ide is best for c++?

552


What is the difference between procedural programming and oops?

561


What are the types of container classes?

622


What is the full form of dos?

570


What is byval and byref? What are differences between them?

1693


What does std mean in c++?

583