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 |
What is an abstract class in C++
0 Answers SwanSoft Technologies,
Write a syntax and purpose of switch statement.
Write a program to input an integer from the keyboard and display on the screen “WELL DONE” that many times.
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
What is name mangling/name decoration?
Without using third variable write a code to swap two numbers.
What Is A Conversion Constructor C++ ?
Execute the qsort () in c/sort() in c++ library or your own custom sort which will sort any type of data on user defined criteria.
Define type casting in C++.
What is Advantage and Use of THIS pointer in C++ – Scenarios?
What is the difference between realloc() and free() in C++?
Consider the following C++ program