#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;
}
{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.
this is to write or create
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.
if n MOD 2 == 0 THEN Write ("Even");
a triangle then a square :)
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 reads in the size of the side of square and then pints a hollow square of that size out of asterisks and blanks?
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.
#include<iostream.h>
Write a program that calculates the area of a triangle in QBASIC
barsanabegam
Try the triangle program on a search engine. Replace numbers with stars and that should do the trick