4. Given the values of three variables a, b and c, write a program to compute and display
the value of x, where
x = a
_______
b - c
Execute your program for the following values:
(a) a = 250, b = 85, c = 25
(b) a = 300, b = 70, c = 70
Comment on the output in each case.
Answers
Answer:
The stuggle of 1857 is a glorious chapter in the history of india.
For the first time,differences regions of India ..appeared united against a common rnemy
program for(a)
#include<iostream.h>
#include<stdio.h>
void main()
{
int a = 250, b = 85, c = 25;
x = a-b-c;
cout("solve for x, thus x=")<<endl;
return 0;
}
program for (b)
#include<iostream.h>
#include<stdio.h>
void main()
{
int a = 300, b = 70, c = 70;
x = a-b-c;
cout("solve for x, thus x=")<<endl;
return 0;
}
Output:
x = a - b - c
(a) a = 250, b = 85, c = 25
x = 250 - 85 - 25
= 140
The value of x in first case that is (a) is 140.
(b) a = 300, b = 70, c = 70
x = 300 - 70 - 70
= 160
The value of x in first case that is (b) is 160.
As computer here takes DMAS(division, multiplication, addition, subtraction) because here none of parenthesis is used if the question was a-(b-c) then output would be different.
https://brainly.in/question/5378237
https://brainly.in/question/35713361
#SPJ2