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 |
Identify the error in the following program. #include<iostream.h> void main() { int i = 0; i = i + 1; cout « i « " "; /*comment *//i = i + 1; cout << i; }
To solve the 8 Queens problem, which algorithm is used?
What is RTTI and why do you need it?
How to delete array of objects in C++? Proof by C++ code for proper deletion
Factory Method C++ – How to delete pointers returned by it
What is Copy Constructor?
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 name mangling/name decoration?
How can a C function be called in a C++ program?
Find the Factorial of a number using a program.
Write a C++ Program to Find Sum and Average of three numbers.
How to reverse a string in C++