Write a program to print the following outputs using for loops.

1
2 2
3 3 3
4 4 4 4
5 5 5 5 5

/**************************************************************/
/*Programmed by : Vivek Patel**********************************/
/*For Bugs Free feel to contact********************************/
/*Website : www.vivekpatel.cjb.net*****************************/
/*Email : vivek_patel9@rediffmail.com**************************/
/**************************************************************/

#include
#include

void main(){
int i,j,k,num;
clrscr();
printf("*****DIGIT TRIANGLE*****\n");
printf("Enter number : ");
scanf("%d",&num);
for(i=1;i<=num;i++){
for(k=num;k>=i;k--)
printf("%c",' ');
for(j=1;j<=i;j++)
printf("%3d",i);
printf("\n");
}

getch();
}



Powered by Wufoo