answersLogoWhite

0

#include<stdio.h>

int main(){

int line,i,j,k;

printf("Enter the no. of lines");

scanf("%d",&line);

for(i=1;i<=line;i++){

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

printf(" ");

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

printf("%d",k);

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

printf("%d",k);

printf("\n");

}

return 0;

}

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

Write a pascal program that compute an area of a triangle?

{A program to compute the area of a triangle} {by Ogboin W. Meshach} Var; b,h:real; BEGIN Writeln('Triangle'); Write('Base: '); Readln(base); Write('Height: '); Readln(height); area:=0.5*base*height; Writeln('Area: ', area :0:2); End.


Write a program to create a maze?

this is to write or create


How do you create pascal's triangle?

1 1 11 2 11 3 3 11 4 6 4 11 5 10 10 5 1...Simply write the triangle below:11 1Then write 1 on the ends and add the two values above the position you're in to get the next triangle.


How do you know if odd or even in turbo pascal program?

if n MOD 2 == 0 THEN Write ("Even");


Write a program in qbasic to make a hut using print statemant?

a triangle then a square :)


Write a program in pascal that declares two integers and gives there sum?

This is not a question so you do not need to use a question mark at the end of your sentence.


Write a program that input a positive integer and prints a triangle using for loop?

write a program that reads in the size of the side of square and then pints a hollow square of that size out of asterisks and blanks?


How can you start the program 'read in the lengths of the sides of a triangle and determine whether the triangle is an isosceles triangle two sides are equal an equilateral triangle three sides are'?

This would depend on what programming language you wanted to write it in. For example, in Pascal, the code might look like this: Program Isosceles; Var A, B, C : Real; Begin WriteLn('Input side A.'); ReadLn(A); WriteLn('Input side B.'); ReadLn(B); WriteLn('Input side C.'); ReadLn(C); If A = B Then Begin If B = C Then Begin WriteLn('This triangle is equilateral.'); End Else Begin WriteLn('This triangle is isosceles.'); And so on.


Write a program in C to create a Circular Linked list?

#include&lt;iostream.h&gt;


How do you write a qbasic program to find area and circumerence of a circle?

Write a program that calculates the area of a triangle in QBASIC


How To write a java program to create three tier applications using servlets?

barsanabegam


How do you write a program to print numbers from star one and next line star two in php?

Try the triangle program on a search engine. Replace numbers with stars and that should do the trick