Write a program to read two numbers from the keyboard and display the larger value on the screen



Write a program to read two numbers from the keyboard and display the larger value on the screen..

Answer / 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

More C++ Interview Questions

What do you by Function Overloading in C++?

0 Answers   Akamai Technologies, Infogain,


Write a C++ program to print strings in reverse order.

0 Answers   Amdocs,


What is bool in C++

0 Answers  


What does it mean to declare a member function as virtual in C++?

0 Answers   Amazon,


Can we call a virtual function from a constructor?

1 Answers  






Factory Method C++ – How to delete pointers returned by it

0 Answers  


In C++ what is the meaning of data hiding?

0 Answers   Aricent,


What is the difference between member functions and static member functions?

0 Answers   Alter,


Discuss the role of C++ shorthands.

0 Answers   Adobe,


Explain encapsulation in C++.

0 Answers   Verifone,


What is static variable and difference between(const char *p,char const *p,const char* const p).

0 Answers   Accenture,


Define type casting in C++.

0 Answers   Amdocs,


Categories