Chapter - 4: The Loop Control Structure

Write a program to produce the following output:


E
Sections
9
Exercises

A

B

C

D

E

1

2

3

4

5

6

7

8

10

11

12

13

14

15

16

9

	      1
						
	1     2	     1
			
   1	   3	   3	   1
			
1	4	6	4	1

#include<stdio.h>
#include<math.h>
#include<conio.h>
int main()
{
	int k = 4, i, j, num;
	for(i = 0; i <= 4; i++ )
	{
		num = pow(11, i);
		
		for(j = k; j ; j--)
			printf("\t");
			
		k--;
		
		while(num)
		{
			printf("%d\t\t", num%10);
			num /= 10;
		}
		printf("\n\n");
	}
        getch();
	return 0;
}

© 2020 Garbage Valuegarbage value logo