Question: Q5: (Multiples) (20 points) Level - Easy. Write a program that reads in two integers and determines and prints whether the first is a multiple
Q5: (Multiples) (20 points) Level - Easy. Write a program that reads in two integers and determines and prints whether the first is a multiple of the second. [Hint: Use the remainder operator.] Q6: (Table of Squares and Cubes) (20 points) Level - Medium Using only the techniques you learned in chapter 2 (no arrays, loops, or functions from math.h), write a program that calculates the squares and cubes of the numbers from 0 to 10 and uses tabs to print the following table of values number square cube 16 25 36 49 64 81 100 27 64 125 216 343 512 729 1000 10 Note: This can be done with a single variable that is incremented for each row. If that variable is named n, think about what happens to the number going from row 0 to row 1, and how you can express the square and cube function in terms of n. You should not define 33 variables for this exercise! Q7: (Separating Digits in an Integer) (20 points) (Extra Credit) Level - Hard. Write a program that inputs one five-digit number, separates the number into its individual digits and prints the digits separated from one another by three spaces each. [Hint: Use combinations of integer division and the remainder operation.] For example, if the user types in 45139, the program should print: Please use C program
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
