C Program To Print Pyramid of Numbers

To print output like
1
2  3
4  5  6
7  8  9  1
2  3  4  5  6

#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,c=1;
clrscr();
for(i=1;i<=5;i++)
{ printf("\n");
for(j=1;j<=i;j++)
{
printf("%4d",c);
c++;
if(c>9)
{
c=0;
c++;
}
}
}
getch();
}
Also read

Hope you liked my posts, give comments if you have any doubts.. :)
Share this post
  • Share to Facebook
  • Share to Twitter
  • Share to Google+
  • Share to Stumble Upon
  • Share to Evernote
  • Share to Blogger
  • Share to Email
  • Share to Yahoo Messenger
  • More...
 
Posts RSSComments RSSBack to top
© 2013 Updated Tech News Results and Reviews