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 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



Write a program to read the values a, b and c and display x, where x=a/b–c. Test the program..

Answer / hr

#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
float a,b,c,x;
cout<<" Enter the value of a,b, &c :"<<endl;
cin>>a>>b>>c;
if((b-c)!=0)
{
x=a/(b-c);
cout<<" x=a/(b-c) = "<<x<<endl;
}
else
{
cout<<" x= infinity "<<endl;
}
return 0;
}
OUTPUT:
Enter the value of a,b,&c:300 70 70
X=infinity

Is This Answer Correct ?    2 Yes 5 No

Post New Answer

More C++ Interview Questions

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

0 Answers   Amdocs,


How do you work around them?

0 Answers   Amazon,


What is the purpose of a constructor? Destructor?

0 Answers   Amazon,


Write a program to input an integer from the keyboard and display on the screen “WELL DONE” that many times.

1 Answers  


Without using third variable write a code to swap two numbers.

0 Answers   Accenture,


What is data abstraction? How is it implemented in C++?

0 Answers   Amdocs,


What is the 4 difference between delete[] and delete?

0 Answers   Alter,


What is an abstract class?

6 Answers   Siemens,


what do you mean by exception handling in C++?

0 Answers   Alter,


What is static variable and difference between(const char *p,char const *p,const char* const p).

0 Answers   Accenture,


What does malloc return in C and C++?

0 Answers   Alter,


When would you choose to return an error code rather than throw an exception?

0 Answers   Amazon,


Categories