Classwork 10 - UMBC-CMSC104/General GitHub Wiki
The goal of this classwork is to practice with math. Please call your code math_practice.c.
You are to read in a number (a double
) from the user and perform a number of analytics on it. Print out:
- The absolute value of the number
- The number mod 5
- The number mod 2.2
- The square root of the absolute value of the number
- The number to the 2nd power
- The number to the 8th power
Your output should look like this:
Welcome to classwork 10!
Please enter a number: -23.0
The absolute value: 23.000000
The number mod 5 : -3.000000
The number mod 2.2: -1.000000
Square root : 4.795831
23 squared : 529.000000
23 to the 8th : 78310985281.000000
To compile:
gcc math_practice.c -o math_practice -lm
To submit:
submit cs104_wilson cw10 math_practice.c