Title: Programming in C: Number Program
Code 1 (10 pts): Create a number program that does the following: It prompts a user to enter a positive whole number greater than 0 and no greater than 10. The program will then do the following:
- Calculate the sum of all numbers from 0 to that number and print it to the console window.
- Create a multiplication table of the number and display it to the console window.
The program will stop running after the above is displayed.
If an invalid number is entered (negative or greater than 10), an error message will be displayed and the program will prompt to enter another number.
Example output is shown below:
Enter a number between 0 and 10: 88
Entered an invalid number.
Enter a number between 0 and 10: -9
Entered an invalid number.
Enter a number between 0 and 10: 7
The sum of 0 to 7 is 28.
Multiplication table of 7:
7 x 1 = 7
7 x 2 = 14
7 x 3 = 21
7 x 4 = 28
7 x 5 = 35
7 x 6 = 42
7 x 7 = 49
7 x 8 = 56
7 x 9 = 63
7 x 10 = 70