About Me

My photo
Raipur, Chhattisgarh, India
Hi , I am Amit Thakur. I have worked as a QA Engineer for two years and as a Java Developer for one year in NIHILENT TECHNOLOGIES PVT. LTD., Pune.Currently I am working as DEAN (Research & Development) in Bhilai Institute of Technology, Raipur.

Tuesday, September 3, 2013

Number Pyramid in C Programming


Program :
#include<stdio.h>
#include<conio.h>
void main()
{
 int i,j;
 int num;
 clrscr();

 printf("\nEnter the number of Digits :");
 scanf("%d",&num);

 for(i=0;i<=num;i++)
 {
    for(j=0;j<i;j++)
        printf("%d ",i);
 printf("\n");
 }
getch();
}
Output :
Enter the number of Digits : 5
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5

No comments: