Write a program to read three variable x, y and z.use conditional statement and evaluate values of variable a,b and c.Check the sums for equality and print different message.

This program reads in three variables, x, y, and z, from the user and calculates the values of three other variables, a, b, and c, using conditional statements. The values of a, b, and c are determined based on the values of x, y, and z. If x is greater than or equal to 5, […]

Write a program to determine the value of b depending on the inputted value of a. The variable a is used with conditional operator.

The above program uses conditional operator to determine the value of ‘b’ based on the inputted value of ‘a’. The conditional operator ‘?’ is used in this program to assign a value to the variable ‘b’. The syntax for the conditional operator is: condition ? expression1 : expression2 If the condition is true, expression1 is […]

Scroll to top