/*
Name: WAP to construct a pyramid of numbers.
Author: Parveen Malik
Date: 18/09/11 09:26
*/
#include<stdio.h>
#include<conio.h>
int main()
{
int i,j,num;
printf("Enter the value of last number to be printed : ");
scanf("%d",&num);
for(i=1;i<=num;i++)
{
printf("\n");
for(j=1;j<=i;j++)
{
printf("%3d",j);
}
}
getch();
return 0;
}
OUTPUT:
0 comments:
Post a Comment