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.


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.


Write a program to create a maze?

this is to write or create


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 :)


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 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 do you write a program in pascal to find area of a trapezium using pascal?

To write a program in Pascal to find the area of a trapezium, you can follow this structure: program AreaOfTrapezium; var a, b, height, area: real; begin writeln('Enter the lengths of the two parallel sides (a and b) and the height:'); readln(a, b, height); area := 0.5 * (a + b) * height; writeln('The area of the trapezium is: ', area:0:2); end. This program prompts the user for the lengths of the parallel sides and the height, calculates the area using the formula ( \text{Area} = 0.5 \times (a + b) \times \text{height} ), and then outputs the result.


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