Ad

Chapter - 4: The Loop Control Structure

Write a program to produce the following output:


Ad
E
Sections
9
Exercises
	      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;
}
Ad

© 2024 Garbage Valuegarbage value logo