Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

closed write a programme to generate the following pattern

0 votes
asked Jun 1, 2019 by anonymous
closed Jun 7, 2019 by Admin
123456
12345
1234
123
12
1
closed with the note: Closing question since already solved.

7 Answers

0 votes
answered Jun 1, 2019 by anonymous
#include <stdio.h>

int main()
{
    int i,j,k=1;
    for(i=1;i<=6;i++)
    {
        for(j=6;j>=i;j--)
        {
            printf("%d",k);
            k++;
        }
        k=1;
        printf("\n");
    }
}
commented Jun 5, 2019 by Archana Shah
#include <stdio.h>

int main()
{
    int i,j,k=1;
    for(i=6;i>=1;i--)
    {
        for(j=1;j<=i;j++)
        {
            printf("%d",j);

        }

        printf("\n");
    }
}
0 votes
answered Jun 2, 2019 by Jack sparrow (220 points)
#include<stdio.h>

int main()

{

int a,i,j,c=1;

scanf("%d",&a);

for(i=a;i>=1;i--)

{

for(j=1;j<=a;j--)

printf("%d",c++);

printf("\n");

}

return 0;

}
0 votes
answered Jun 3, 2019 by anonymous
#include <stdio.h>

int main()

{

int l,m,n=1;

for (l=0;l<6;l++)

  {

    for (m=0;m<6;--m)

      {

           printf("%d",n);

           n++;

       }

   n=1;

  printf("\n");

  }

}
0 votes
answered Jun 3, 2019 by anonymous
public class Main

{

    static int k=0;

public static void main(String[] args) {

    for(int i=1;i<=6;i++){

        for(int j = 6;j>=i;--j){

            k++;

            System.out.print(k);

        }

        k=0;

        System.out.print("\n");

    }

}

}
0 votes
answered Jun 3, 2019 by Jack sparrow (220 points)
#include<stdio.h>

int main()

{

int a,i,j,c=1;

for(i=1;i<=a;i++)

{

for(j=1;j<=a;j--)

{

printf("%d",c++)

}

c=1

printf("\n");

}

return 0;

}
0 votes
answered Jun 4, 2019 by AZHARUDEEN S (140 points)
#include<stdio.h>

int main()

{

int num,i,j,sp,a=1;

scanf("%d",&num);

for(i=1;i<=num;i++)

{

for(sp=1;sp<row;sp--)

{

printf(" ");

}

for(j=1;j<=num;j++)

{

printf("%d,a);

return 0;

}
0 votes
answered Jun 4, 2019 by vishnu
#include<stdio.h>

int main()

{

int input,col,line,value;

scanf("%d",&input):

for(line=1;line<=input;line++)

{

value=1;
for(col=line;col<=ip;col++)

{
printf("%d",value);

value++;

}
printf("\n");

}
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...