Professional Documents
Culture Documents
Use of If-Else Statement: Assignment # 02
Use of If-Else Statement: Assignment # 02
Use of If-Else Statement: Assignment # 02
f. main( )
{
int k = 35 ;
printf ( "\n%d %d %d", k ==
35, k = 50, k > 40 ) ;
}
b. Run the program and try to find out the ASCII values of mentioned characters
f. If the ages of X, Y and Z are input through the keyboard, write a program to determine
the youngest of the three.
g. Write a program to check whether a triangle is valid or not, when the three angles of the
triangle are entered through the keyboard. A triangle is valid if the sum of all the three
angles is equal to 180 degrees.
h. Find the absolute value of a number entered through the keyboard. For example, if the
given number is 5 then the result would be 5, or if the given number is -5 then the result
will be 5.
i. Given a point (x, y), write a program to find out if it lies on the x-axis, y-axis or at the
origin (0, 0).