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 ? | 2 Yes | 0 No |
What is latest update of C++ ?
Tell us the size of a float variable.
How to convert integer to string in C++
Identify the error in the following program. include<iostream> using namespace std; void main() { int num[]={1,2,3,4,5,6}; num[1]==[1]num ? cout<<"Success" : cout<<"Error"; }
What is RTTI and why do you need it?
Explain encapsulation in C++.
What is the difference between public, private, and protected inheritance?
write a program To generate the Fibonacci Series.
What is the difference between an ARRAY and a LIST in C++?
What Are The Differences Between A C++ Struct And C++ Class?
What are the advantages/disadvantages of using inline and const?
What is a COPY CONSTRUCTOR and when is it called?