Given the following: printf ( “Enter your age in years: “ ); scanf ( “%d”, &age_in_years ); int is_voting_age = ( age_in_years >= 18 ); int is_drinking_age = ( age_in_years >= 21 ); int can_be_president = ( age_in_years >= 35 ); int is_senior_citizen = ( age_in_years >= 65 ); When the age entered is 33, what are the values of the variables above? When the age entered is 12, what are the values of the variables above? Write an IF statement in a function to print ‘Yes’ for each value above that is true.
Max Function
Statistical function is of many categories. One of them is a MAX function. The MAX function returns the largest value from the list of arguments passed to it. MAX function always ignores the empty cells when performing the calculation.
Power Function
A power function is a type of single-term function. Its definition states that it is a variable containing a base value raised to a constant value acting as an exponent. This variable may also have a coefficient. For instance, the area of a circle can be given as:
- Given the following:
printf ( “Enter your age in years: “ );
scanf ( “%d”, &age_in_years );
int is_voting_age = ( age_in_years >= 18 );
int is_drinking_age = ( age_in_years >= 21 );
int can_be_president = ( age_in_years >= 35 );
int is_senior_citizen = ( age_in_years >= 65 );
- When the age entered is 33, what are the values of the variables above?
- When the age entered is 12, what are the values of the variables above?
- Write an IF statement in a function to print ‘Yes’ for each value above that is true.
Step by step
Solved in 3 steps with 1 images