Computer Science, asked by shardul1925, 1 year ago

Hoping for gud answers:)

Please do not answer if you do not know..

Attachments:

shardul1925: hlo 1722

Answers

Answered by generalRd
9

hi

here's the correct answer

Programming using C, loops jini

/*

C program to print number pattern

*/

#include <stdio.h>

int main()

{

int i, j, N;

printf("Enter N: ");

scanf("%d", &N);

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

{

// Logic to print spaces

for(j=1; j<=N-i; j++)

{

printf(" ");

}

// Logic to print numbers

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

{

printf("%d", j);

}

printf("\n");

}

return 0;

The step-by-step descriptive logic to print spaces is:

To print spaces, run an inner loop from 1 to N - i. Inside this loop print single blank space.

output

enter N=5

1

21

321

4321

5321

hope it helps

plz mark me brainliest


shardul1925: is it only for the points
shardul1925: plzz write in java language
generalRd: oh
shardul1925: hmm..
Answered by Anonymous
4

Answer:

1

12

123

1234

12345

#include<stdio.h>

#include<conio.h>

void main()

{

int i,j,row;

clrscr();

printf("\nHow many rows\n");

scanf("%d",&row);

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

{

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

{

printf("%d",j);

}

printf("\n");

}

getch();

}

Similar questions