Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Write a program to read two numbers from the keyboard and display the larger value on the screen



Write a program to read two numbers from the keyboard and display the larger value on the screen..

Answer / 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 ?    2 Yes 0 No

Post New Answer

More C++ Interview Questions

How does stack look in function calls? Write a recursive function call, how will the stack look like?

0 Answers   Adobe,


Briefly explain various access specifiers in C++.

0 Answers   Amdocs,


What is a virtual function in C++?

0 Answers   C DAC,


What is the difference between realloc() and free() in C++?

0 Answers   IBS, TCS,


C++ supports multiple inheritance. What is the “diamond problem” that can occur with multiple inheritance? Give an example.

0 Answers  


What are the advantages/disadvantages of using #define?

0 Answers   Amazon,


Write a C++ program to print strings in reverse order.

0 Answers   Amdocs,


Explain what happens when an exception is thrown in C++.

0 Answers   Amazon,


How to invoke a C function using a C++ program?

0 Answers   Alter,


Consider the following C++ program

0 Answers  


Can we provide one default constructor for our class?

0 Answers  


Can we call a virtual function from a constructor?

1 Answers  


Categories