#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.
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 that reads in the size of the side of square and then pints a hollow square of that size out of asterisks and blanks?
#include<iostream.h>
barsanabegam
Write a program that calculates the area of a triangle in QBASIC
it would help you logically.. and would simply introduce to you what is programming.. and about coding.. as having knowledge about this turbo pascal.. it is like studying first the logic needed in coding... ^^. Well, this question implies two things. First, the programming language Pascal is good because it is simple and easy to learn, compared to other languages e.g. C or Java. The code written in Pascal is also easy to read. There is less bugs (mistakes) when we write programs in Pascal, again compared to C. Second, the Turbo Pascal (software package) is a good environment for us to conveniently write Pascal programs. There are shortcut keys to compile and run the program. There are tools for debugging (correcting mistakes) in our code, too.