answersLogoWhite

0


Best Answer

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

13y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

14y ago

/* INPUT: 5

* OUTPUT: 55555

* 54444

* 54333

* 54322

* 54321

*/

import java.io.*;

class SeriesType

{

protected static void main()throws IOException

{

BufferedReader in=new BufferedReader(new InputStreamReader(System.in));

System.out.print("Enter the number of rows: ");

int a=Integer.parseInt(in.readLine()),c=0,d=0;

int b[]=new int[a];

for(int x=0;x<a;x++)

{

System.out.println();

for(d=0;d<a;d++)

{

b[d]=c;

if(c<x)

c++;

}

for(c=0;c<a;c++)

System.out.print(a-b[c]);

c=0;

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

#include <stdio.h>

#include <conio.h>

void main (void)

{

int i, j, count = 0;

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

{

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

{

count++;

printf("%d",count);

}

printf("\n");

}

getch();

}

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

int size = 20;

for(int row=1;row<=size;row++){

int a = row;

while(a++ < (size-1)){

System.out.print(" ");

}

int x = 2*row-1;

for(a = row;a<x;a++){

System.out.print(""+(a%10));

}

for(a=x;a>=row;a--){

System.out.print(""+(a%10));

}

System.out.println();

}

try thiss

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

#include<stdio.h>

main()

{

int i,n,j,k,y;

printf("enter the number :");

scanf("%d",&n);

for (j=n;j>0;j--)

{

for (k=n-j;k>0;k--)

printf(" ");

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

printf("%d ",i);

for (i=j-1;i>0;i--)

printf("%d ",i);

for (k=n-j;k>0;k--)

printf(" ");

printf("\n");

}

}

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

public class Test{

/**

* @param args

*/

public static void main(String[] args) {

for(int i = 0; i < 10; i++) {

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

System.out.print(j);

}

System.out.println("");

}

}

}

Output:

1

21

321

4321

54321

654321

7654321

87654321

987654321

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

5432112345

5432 2345

543 345

54 45

5 5

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

#include <stdio.h>

int main (void)

{ puts ("1 123 12345 134567 12345679");

return 0;

}

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

#include <stdio.h>

int main (void)

{ puts ("1 121 12321 1234321"); return }

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a program of pyramid to print 12345678910?
Write your answer...
Submit
Still have questions?
magnify glass
imp