Find the Area of the Cylinder?

The formula is 2*3.14+2*3.14?

 

Program Area;

VAR

Height, Radius, Area, Integer;

 

Begin

Writeln (“Enter height to calculate”);

Readln (Height);

Writeln (“Enter Radius to calculate”);

Readln (Radius);

Writeln (“Display the result of Area”);

Area=2*3.14 (r * r) + 2*3.14 * r * h;

Writeln Area;

 

End.

 

What  are the rules you have to follow to introduce a variable to a program?

 

First you have to identify the data types and the size of the variable your going to use.

 

You have to introduce (declare) these are the variable you are going to use.

 

The section of the declaration area. This declaration must directly after the program heading and is marked by the VAR Keyboard.

 

The variable name are maximum of 32 alphanumeric characters. First letter of the data name must be alphabetic.

 

We cannot use scientific symbols, keywords, space for variety declaration.

 

Program-   is the first word of all Pascal programs. It is a keyboard (you cannot use keyboard to describe variables).

 

Title-   is the name of the program. It is an identifier. Identifiers begin with a letter or the underscore character (-).

 

Uses wincrt-    is to indicate that windows environment is used in your program.

 

Begin-    Defines the starting point of the program.

 

Cirsir-       is to dear the console screen.

 

End-    This must always be the final statement of a Pascal program.

 

Output– the keywords write and writeln are used to display outputs.

 

Write-  The write statement leaves the cusor at the end of the currents out put (it does not go to the next line).

 

Writeln-  The writeln leaves the cusor at the beginning of the next line (it goes to the next line.