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
What are punctuators in c++?
What does and I oop mean?
explain sub-type and sub class? atleast u have differ it into 4 points?
C is to C++ as 1 is to a) What the heck b) 2 c) 10
Is java easier than c++?
What is encapsulation example?
what is pre-processor in C++?
Comment on assignment operator in c++.
What is overloading unary operator?
Which is most difficult programming language?
What is difference between c++ and c ++ 14?
What are the four main data types?
Should I learn c++ c?
Is c++ a high level language?
Which ide is best for c++?