-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathex6.c
31 lines (25 loc) · 803 Bytes
/
ex6.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Write a program that uses looping to print the following table of values. Use the tab escape sequence, \t, in the printf statement to separate the columns with tabs.
// N 10*N 100*N 1000*N
// 1 10 100 1000
// 2 20 200 2000
// 3 30 300 3000
// 4 40 400 4000
// 5 50 500 5000
// 6 60 600 6000
// 7 70 700 7000
// 8 80 800 8000
// 9 90 900 9000
// 10 100 1000 10000
#include <stdio.h>
int main()
{
int n;
// Print the table header
printf("N\t10*N\t100*N\t1000*N\n");
// Loop from 1 to 10
for (n = 1; n <= 10; n++)
{
printf("%d\t%d\t%d\t%d\n", n, 10 * n, 100 * n, 1000 * n);
}
return 0;
}