5a-)WAP to print following outputs: 1 ....2 2 ..... 3 3 3 ....... 4 4 4 4 ....... 5 5 5 5 5 .

 

/*Program to print
  1
  22
  333
  4444
  55555*/
  #include<stdio.h>
  #include<conio.h>

  int main()
  {
      int i, j;
      for(i=1;i<=5;i++)
      {
          for(j=1;j<=i;j++)
          {
              printf("%d",i);
          }
          printf("\n");
      }
      return 0;
  }
    
Output:-
1 2 2 3 3 3 4 4 4 4 5 5 5 5 5
****** Thank you *****

Comments

Popular posts from this blog

18 Amazing programs in C.