Monday 23 July 2012

c program print Pyramid from 4 to 10

 Pyramid Pattern no. 4 1to 10 with code

/* To print Pyramid Pattern shown below
2
3 4
4 5 6
5 6 7 8
6 7 8 9 10
*/

#include<stdio.h>
int main()
{
int i,j,n,k=2;

printf("Enter no. of lines: ");
scanf( "%d",&n);


//for loop for number of lines
for(i=1;i<=n;i++)
 {
 k=i+1;
for(j=1;j<=i;j++)
{
printf("%d ",k);
 k++;
 }
 printf("\n");
 }
 return 0;
 }
Share This
Previous Post
Next Post

FYJC XI standard online admisson Process and declaraton of Merit list . Cut off List For prevous year also . 10 Th Results onlne declaraton Maharashtra Region .

0 comments: