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


Please Help Members By Posting Answers For Below Questions

How do I convert a stl file?

765


What would happen on forgetting [], while deallocating an array through new?

834


Write a program in c++ to print the numbers from n to n2 except 5 and its multiples

2241


What is class and object with example?

796


Write a program to concatenate two strings.

780


Describe friend function & its advantages.

918


What is encapsulation in c++ with example?

753


What happens when you make call 'delete this;'?

801


What are the fundamental features of an object-oriented language?

708


What are maps in c++?

707


Can private class be inherited?

882


What are the important differences between c++ and java?

829


Explain why C++ is not purely Object Oriented Language

758


Does c++ have foreach?

735


What is heap sort in c++?

844