Write a C program which will print the pattern on monitor , the integer N will be taken from key board
1
12
123
1234
12345
_____
_____
12345____n
#include <stdio.h>
#include <stdlib.h>
int main(){
int i,j;
int number;
printf("Enter number: ");
scanf("%d",&number);
for (i = 1; i <= 10; i++) {
for (j = 1; j <= i; j++) {
printf("%d",j);
}
printf("\n");
}
getchar();
getchar();
return 0;
}
Comments
Leave a comment