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 |
CDPATH shell variable is in(c-shell)
Factory Method C++ – How to delete pointers returned by it
What is the difference between malloc, calloc and realloc?
Find the Factorial of a number using a program.
Discuss the role of C++ shorthands.
What kind of problems does name mangling cause?
How will you print a list of all unique words from a string which may contain repeated words?
What's the value of the expression 5["abxdef"]?
What is the difference between Stack and Queue in C++?
0 Answers Global Logic, iNautix,
Tell How To Check Whether A Linked List Is Circular ?
Write a C++ Program to Reverse a Number using while loop.
Define namespace.