pascal cheat sheett
exit;
pascal cheat sheett
type
Books = record
title: packed array [1..50] of char;
author: packed array [1..50] of char;
subject: packed array [1..100] of char;
book_id: integer;
end;
pascal cheat sheett
type
days, age = integer;
yes, true = boolean;
name, city = string;
fees, expenses = real;
pascal cheat sheett
type
Rptr = ^real;
Cptr = ^char;
Bptr = ^ Boolean;
Aptr = ^array[1..5] of real;
date-ptr = ^ date;
Date = record
Day: 1..31;
Month: 1..12;
Year: 1900..3000;
End;
var
a, b : Rptr;
d: date-ptr;
pascal cheat sheett
var
choice: boolean;
pascal cheat sheett
Sr.No Control Statement & Description
1 break statement
Terminates the loop or case statement and transfers execution to the statement immediately following the loop or case statement.
2 continue statement
Causes the loop to skip the remainder of its body and immediately retest its condition prior to reiterating.
3 goto statement
Transfers control to the labeled statement. Though it is not advised to use goto statement in your program.
pascal cheat sheett
VELOCITY_LIGHT = 3.0E=10;
PIE = 3.141592;
NAME = 'Stuart Little';
CHOICE = yes;
OPERATOR = '+';
pascal cheat sheett
program addFiledata;
const
MAX = 4;
type
raindata = file of real;
var
rainfile: raindata;
filename: string;
procedure writedata(var f: raindata);
var
data: real;
i: integer;
begin
rewrite(f, sizeof(data));
for i:=1 to MAX do
begin
writeln('Enter rainfall data: ');
readln(data);
write(f, data);
end;
close(f);
end;
procedure computeAverage(var x: raindata);
var
d, sum: real;
average: real;
begin
reset(x);
sum:= 0.0;
while not eof(x) do
begin
read(x, d);
sum := sum + d;
end;
average := sum/MAX;
close(x);
writeln('Average Rainfall: ', average:7:2);
end;
begin
writeln('Enter the File Name: ');
readln(filename);
assign(rainfile, filename);
writedata(rainfile);
computeAverage(rainfile);
end.
pascal cheat sheett
readln (a, b, c);
s := (a + b + c)/2.0;
area := sqrt(s * (s - a)*(s-b)*(s-c));
writeln(area);
pascal cheat sheett
+ Adds two operands A + B will give 30
- Subtracts second operand from the first A - B will give -10
* Multiplies both operands A * B will give 200
/ Divides numerator by denominator B / A will give 2
% Modulus Operator and remainder of after an integer division B % A will give 0
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us