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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Differentiate between late binding and early binding. What are the advantages of early binding?

1082


What is the default width for ouputting a long integer using the insertion operator?

1300


What is basic concept of oop?

1224


explain sub-type and sub class? atleast u have differ it into 4 points?

2364


How delete [] is different from delete?

1053


what are the iterator and generic algorithms.

2232


Why is it necessary to use a reference in the argument to the copy constructor?

1177


What is friend class in c++ with example?

1119


Explain the difference between c & c++?

1142


What is ifstream c++?

1082


What is setbase c++?

1206


What are the three main types of variables?

1184


What is polymorphism and why is it important?

1100


Should I learn c++ c?

1105


Discussion on error handling of C++ .

1162