Pyramid of Numbers C program


This Program is to produced the following out put.       
      1
   1 2 3
1 2 3 4 5
It is a part of Mumbai University MCA Colleges Programming in C MCA Sem 1 


#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,k;
clrscr();
for(i=1;i<=5;i=i+2)
{
printf("\n");
for(k=5;k>i;k=k-2)
{
printf(" ");
}
for(j=1;j<=i;j++)
{
printf("%d",j);
}
}
getch();
 }

Hope this Program is useful to you in some sense or other. Keep on following this blog for more Mumbai University MCA College Programs. Happy Programming and Studying.

1 comment: