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
What is cohesion in oop?
Is C++ case sensitive a) False b) Depends on implementation c) True
What is type of 'this' pointer?
What is jump statement in C++?
What are oops methods?
Is java as fast as c++?
What are keywords in c++?
What do you mean by public protected and private in c++?
What is the use of 'using' declaration in c++?
Why would you use pointers in c++?
What is the best way to declare and define global variables?
Can member data be public?
Can a new be used in place of old mallocq? If yes, why?
Why is it so that we can have virtual constructors but we cannot have virtual destructors?
What are dynamic type checking?