Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

jyhkhg

Program Area(output);
var a,b,c,tx,x,y,z:integer;
begin
    writeln('Choose The Graph For You To Print Area');
    writeln('Square=1');
    writeln('Rectangle=2');
    writeln('Triangle=3');
    writeln('Parallelogram=4');
    writeln('Trapezoid=5');
    read(z);
case z of
1:  begin
        writeln('x=');
        read(x);
        for a:=1 to x do
        begin
            writeln;
            for b:=1 to x do
            begin
                write('[x]');
            end;
        end;
    end;
2:  begin
        writeln('x=');
        read(x);
        writeln('y=');
        read(y);
        for a:=1 to y do
        begin
            writeln;
            for b:=1 to x do
            begin
                write('[x]');
            end;
        end;
    end;
3:  begin
        writeln('x=');
        read(x);
        for a:=1 to x do
        begin
            writeln;
            for b:=1 to a do
            begin
                write('[x]');
            end;
        end;
    end;
4:  begin
        writeln('x=');
        read(x);
        writeln('y=');
        read(y);
        for a:=1 to y do
        begin
            writeln;
            for b:=1 to a do
            write('  ');
            for c:=1 to x do
            write('[x]');
        end;
    end;
5:  begin
        writeln('tx=');
        read(tx);
        writeln('y=');
        read(y);
        if (tx=1) or (y=1) then 
            begin
                writeln;
                writeln('Input Error');
            end
        else
            begin
                x:=tx-1;
                for a:=1 to y do
                begin
                    writeln;
                    for b:=1 to a do
                    write('[x]');
                    for c:=1 to x do
                    write('[x]');
                end;
            end;
    end;
else
    writeln;
    writeln('Input Error');
end;
end.

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.