Reference no: EM132210059
Answer the Following Question:
Problem 1
Write a program to generate and display a table of n and n2, for integer values of n ranging from 1 to 10. Include appropriate column headings. Make sure the table and headings are formatted into two well-aligned columns.
Problem 2
Write a program that uses two for loops. The first for loop prints the odd numbers from 1 to 13. The second for loop prints the even numbers from 2 to 16.
Problem 3
Write a program that asks the user to enter four digits (separated by spaces) and then prints those digits in English.
For example
Enter three digits: 1 2 3 4
You entered digits: one two three four
Your program should use a switch structure inside a for loop.
Problem 4
The factorial of a positive integer n is the product of all integers from 1 to n.
For example: 6! = 1 .2 .3 .4 .5 .6
Write a program that uses nested for loops to generate a table of the first 10 positive integers and their factorials. Include appropriate column headings. Make sure the table and headings are formatted into two well-aligned columns.