answersLogoWhite

0

output will

1

12

123

1234

12345

//mycfiles.wordpress.com #include

#include

void main()

{

int i,j;

clrscr();

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

{

printf("\n");

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

printf("%d",j);

}

getch();

}

To reverse the output

12345

1234

123

12

1

//mycfiles.wordpress.com

#include

#include

void main()

{

int i,j;

clrscr();

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

{

printf("\n");

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

printf("%d",j);

}

getch();

}

improved::::::

#include

#include

#include

void main()

{

int i,j,k;

printf("Please enter your desired value:");

scanf("%d",&k);

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

{

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

printf("%d",j);

printf("\n");

}

printf("Press any key to close.");

getch();

}

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

Write an assembly language program to print a to z on screen?

write a program to print A to Z on screen in c?


Write a unix program to print print a pattern?

echo 'print a pattern'


Write a java script program to print first ten odd natural numbers in C?

Q.1 Write a program to print first ten odd natural numbers. Q.2 Write a program to input a number. Print their table. Q.3 Write a function to print a factorial value.


Write a program to Print pyramid of numbers using java?

hi question is here, 1 1 2 1 2 3 1 2 3 4


Write a C program to print the following series 112 122 . 1n2?

write a program to print the series 1/12+1/22+.........+1/n2 ?


Write a program to print the sum of a sparse matrix?

This is a directive, not a question.


Can you Write a program in 'c' to print symbols of playing cards?

Yes.


Write a c program to print roman letters?

good morning


Q2 Write a program to print even numbers between 10 and 50?

You can use int i; for (i = 10; i &lt;= 50; i += 2) {//print i} as a program to print even numbers between 10 and 50.


Write c program to print?

include &lt;stdio.h&gt; int main (void) { puts ("print"); return 0; }


Write a C Program to print sum of squares of odd numbers?

#include


What is the code of a program that construct a program that displays a pyramid on the screen?

Here's a simple Python program that constructs and displays a pyramid: def print_pyramid(height): for i in range(height): print(' ' * (height - i - 1) + '*' * (2 * i + 1)) print_pyramid(5) This code defines a function print_pyramid that takes the height of the pyramid as an argument and prints a pyramid made of asterisks (*). Adjust the height parameter in the print_pyramid function call to change the size of the pyramid.