Computer Sciences

This blog gives you informations about internet, programming and computing news...

vendredi 1 juillet 2016

Pascal - Lesson 2

PROGRAMMING PASCAL

LESSON 2


In this lesson we will learn variables integer; real; char; string...
Example:
Integer: 25 4 -2 3 85
Real: 120.36 -9.66 45.12
Char: A B C D E f g h i j k l
String: PASCAL programming Hello

we put variables after uses wincrt line.
Example var Num1,Num2:Integer;

Integers have ranges limits and types










Reals also have types:

You can use Real or Double.


Operators in Pascal
+ Addition
- Substraction
* Multiplication
/ Division (Integer/real result)
DIV Division (Integer result)
MOD Division (Integer result the rest of division)
> Superiour
< Inferiour
   <> Differnce
   = Equality

When we use variables we use in the main program readln to read the varible
Example

program test;
uses wincrt;
var Num1:Integer;
begin
write('Enter an integer');
readln(Num1);
write(Num1);
end.

Aucun commentaire:

Enregistrer un commentaire