Quiz 2 assignment - UMBC-CMSC104/General GitHub Wiki
You are to write a program that prints out a multiplication table from 0 to 5 using nested loops. Calls this program quiz2.c.
Your output should look like this:
Multiplication Table
0 1 2 3 4 5
0 0 0 0 0 0 0
1 0 1 2 3 4 5
2 0 2 4 6 8 10
3 0 3 6 9 12 15
4 0 4 8 12 16 20
5 0 5 10 15 20 25
Hints:
Use '\t' (tab) in your print statements for spacing instead of regular spaces. So:
printf("0\t1\t2");
For this to work properly, you will most likely need a for loop structure akin to this:
for(/* Bounds go here */)
{
for(/* Bounds go here */)
{
/* Code goes here */
}
printf("\n");
}
Extra credit
You can get up to 5 points of extra credit by extending the multiplication table such that its size is dictated by a user value.
That is, prompt for a number. If the user enters a 10, show a multiplication table from 0 to 10. If the user enters 7, show a multiplication table from 0 to 7.
To submit:
submit cs104_wilson quiz2 quiz2.c