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
#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 |
write a program To generate the Fibonacci Series.
How do you work around them?
What are the advantages and disadvantages of B-star trees over Binary trees?
What are "pure virtual" functions?
0 Answers Adobe, Alter, iNautix,
Declare a pointer to a function that takes a char pointer as argument and returns a void pointer.
What are Agilent PRECOMPILERS?
Explain the operator overloading feature in C++ ?
What is meant by exit controlled loop?
What are the advantages/disadvantages of using inline and const?
How to input string in C++
Tell How To Check Whether A Linked List Is Circular ?
What is an algorithm (in terms of the STL/C++ standard library)?