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 ? | 1 Yes | 0 No |
Consider the following C++ program
Write a program to read two numbers from the keyboard and display the larger value on the screen
Can we use THIS Pointer in static function – Reason in C++?
What Is A Default Constructor in C++ ?
What is a class in C++?
0 Answers Amazon, TCS, UGC Corporation,
What is a COPY CONSTRUCTOR and when is it called?
Is there a difference between class and struct?
what is a pragma in C++?
How to delete array of objects in C++? Proof by C++ code for proper deletion
Tell me about virtual function
Define type casting in C++.
Write a C++ Program to Display Number (Entered by the User).