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:
Post a Comment