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 |
How to input string in C++
What are pass by value and pass by reference?what is the disadvantage of pass by value?
what do you mean by exception handling in C++?
How does stack look in function calls? Write a recursive function call, how will the stack look like?
What is the difference between an ARRAY and a LIST in C++?
Without using third variable write a code to swap two numbers.
Define namespace.
When would you use a pointer? A reference?
What is latest update of C++ ?
Write a program to display the following output using a single cout statement Maths=90 Physics=77 Chemistry = 69
Discuss the role of C++ shorthands.
Write a program to read the values a, b and c and display x, where x=a/b–c. Test the program for the following values: (a) a = 250, b = 85, c = 25 (b) a = 300, b = 70, c = 70