{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 pascal program to compute and print area of a circle ac=2πr^2
#include<stdio.h> void main() { char a[]="computer"; int i,j; clrscr(); for(i=0;i<8;i++) { for(j=0;j<i+1;j++) { printf("%c",a[j]); } printf("\n"); } getch(); }
Faisal
No, you can use a decision structure to test a condition in any part of the program and execute some action based on the outcome but you cannot use a decision structure alone to write a complete program.
It would depend on the program you are using and weather or not it is allowable.
Write a c program to compute the surface area and volume of a cube
{Area s the area of cube} {Length is the length of one side of the cube} program AreaofCube; var Area,Length:real; begin write('Enter the length of cube: '); readln(Length); Area:=6*(Length*Length); writeln('The area of cube is ', Area, ' cm^2.'); end.
there is no solution of this problem...........that's it..........
if n MOD 2 == 0 THEN Write ("Even");
if u give control ratios used in budgeting i can write program in C/C++
nr\m;laeoh9y0m g.qthnedxc In fortran: do i=1,5 write(6,*)i enddo stop end This program will write the numbers 1 to 5 on the screen.
int x= 1; int y= 2;
$n = 10*(1+10)/2;
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.
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.
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.