Q#4: Program the following. · Prompt user to input distance in Kilometers and display it in meters. · Input any number from user and generate its square e.g. square of 8 is 64 · Input any number from user and generate its cube e.g. cube of 8 is 512 · Input a 4 digit number in any integer type variable and sum all the four digits, e.g. int a =3487, result = 22
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:
Q#4:
· Prompt user to input distance in Kilometers and display it in meters.
· Input any number from user and generate its square e.g. square of 8 is 64
· Input any number from user and generate its cube e.g. cube of 8 is 512
· Input a 4 digit number in any integer type variable and sum all the four digits, e.g. int a =3487,
result = 22
· Generate the table for a number input by the user.
· For the following equation 3x 4 + 4x 3 + x 2 + 7x + 9, substitute the user provided value of x and
generate the result.
Language C
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images