Saturday, April 13, 2013

Pattern: 1 22 333 4444 55555

Write a program to print 1 
                                                                           22
                                   333
                                   4444
                                   55555 



#include<stdio.h>
#include<conio.h>
void main()
{
    int a,b;
    for(a=1;a<=5;a++)
    {
        for(b=1;b<=a;b++)
        {
            printf("%d",a);
        }
        printf("\n");
    }
}

12 comments:

  1. #include
    #include
    main()
    {
    int i,j,n;
    printf("Enter the value of range:");
    scanf("%d",&n);
    for(i=1;i<=n;i++)
    {
    for(j=1;j<=i;j++)
    {
    printf("%d",i);
    }
    printf("\n");
    }
    }

    ReplyDelete
  2. 55555
    4444
    333
    22
    1
    i want to make this program.

    ReplyDelete
    Replies
    1. This comment has been removed by the author.

      Delete
    2. for(i=n;i>=1;i--) {
      for(j=i;j>= 1;j--) {
      printf("%d",i);
      }
      printf("\n");
      }

      Delete
  3. This comment has been removed by the author.

    ReplyDelete
  4. how to fnd their sum

    ReplyDelete
  5. #include
    int main()
    {
    char i;
    int j;
    for(i=65;i<80;i++)
    {
    for(j=1;j<=i-64;j++)
    {
    printf("%c ",i);
    }
    printf("\n");
    }
    return 0;
    }

    ReplyDelete
    Replies
    1. output:
      A
      B B
      C C C
      D D D D
      E E E E E
      F F F F F F
      G G G G G G G
      H H H H H H H H
      I I I I I I I I I
      J J J J J J J J J J
      K K K K K K K K K K K
      L L L L L L L L L L L L
      M M M M M M M M M M M M M
      N N N N N N N N N N N N N N
      O O O O O O O O O O O O O O O

      Delete
  6. Multiplication table from 1 to 10

    ReplyDelete
  7. Plz reply me fast tomorrow is my exam

    ReplyDelete
  8. please answer the this question input is 3 output should be
    333
    313
    312
    333

    ReplyDelete