Anonymous
Anonymous asked in Computers & InternetProgramming & Design · 8 years ago

answer the following programming?

Please write the code for the following program in C:

sample input :4

Sample output :

1

1 2

1 2 3

1 2 3 4

3 Answers

Relevance
  • 8 years ago
    Favorite Answer

    The algorithm is:

    get number n

    for i is 1 to n

    for j is 1 to i

    print j + a space

    next j

    print newline

    next i

    Source(s): Experience
  • 8 years ago

    Have a try. I'll help you if you get stuck

  • 8 years ago

    int i, j, n;

    printf("Enter an integer\n");

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

    {

    for(j=1;j<=i;j++) printf("%d",j);

    printf("\n");

    }

Still have questions? Get your answers by asking now.