Q-1.For the following values, write a program to evaluate the expression
z = a*b*(c/d)-e*f;
a=10
b=7
c=15.75
d=4
e=2
f=5.6
Q-2.Write a C++ program to evaluate the area and perimeter of the rectangle
Q-3.Write a C++ program to evaluate the volume of a cylinder
Q-4.- Write a C++ program to evaluate the net salary of an employee given the following constraints:
Basic salary: $ 12000
DA: 12% of Basic salary
HRA: $150
TA: $120
Others: $450
Tax cuts — a) PF :14% of Basic salary and b) IT: 15% of Basic salary Net Salary = Basic Salary + DA + HRA + TA + Others — (PF + IT)
Q-5.What is the assigned (left-hand side) value in each case?
int s, m=3, n=5, r, t;
float x=3.0, y;
t = n/m;
r = n%m;
y = n/m;
t = x*y-m/2;
x = x*2.0;
s = (m+n)/r;
y = --n;
Q-6.Write a C++ program which will take the input as a floating (real) number. This number represents the centimeters. Print out the equivalent number of feet (floating, 1 decimal) and inches (floating, 1 decimal), with feet and the inches given to an accuracy of one decimal place.
Assume 2.54 centimeters per inch, and 12 inches per foot.
If the input value is 333.3, the output format should be:
333.3 centimeters is 10.9 feet
333.33 centimeters is 131.2 inches
Q-7.- Find the value of iResult for the following assignment statements:
int iResult, a = 10, b = 8, c = 6, d = 5, e =2;
iResult = a - b - c - d;
iResult = a - b + c - d;
iResult = a + b / c / d;
iResult = a + b / c * d;
iResult = a / b * c * d;
iResult = a % b / c * d;
iResult = a % b % c % d;
iResult = a - (b - c) - d;
iResult = (a - (b - c)) - d;
iResult = a - ((b - c) - d);
iResult = a % (b % c) * d * e;
iResult = a + (b - c) * d - e;
iResult = (a + b) * c + d * e;
iResult = (a + b) * (c / d) % e;
Q-8.If a is 15, then what would be the value of:
printf ("%d”, ++a);
printf ("%d”, a++);
printf ("%d”, --a);
printf ("%d”, a--);
Q-9.What is the error in?
int a;
3=a
Q-10.What would be the output of?
printf("%d\n",1==5==5);