Program:- Write a C Program To print the given pattern. - Pratik Ghelani

Pratik Ghelani

Breaking

Friday, March 29, 2019

Program:- Write a C Program To print the given pattern.

Program:- Write a C Program To print the given pattern.
1
22
333
4444

Program:-
  1. #include <stdio.h>
  2.  
  3. void main() {
  4. for(int i = 1; i < 5; i++) {
  5. for(int j = 0; j < i; j++) {
  6. printf("%d", i);
  7. }
  8. printf("\n");
  9. }
  10. }

Output:-

1
22
333
44444




No comments:

Post a Comment