Powered By Blogger

Monday, March 7, 2016

IF CLAUSE

Let's learn how to use 'IF CLAUSE' in 

Turbo Pascal

  • If clause is used in 3 types.

  • IF/THEN/ENDIF
    IF/THEN/ELSE/ENDIF
    NESTED IF
 I WILL TEACH YOU HOW TO USE 'IF/THEN/ENDIF' TYPE IN THIS ARTICLE

  Here is the pascal code for finding a number greater than 10. try this program.

PROGRAM LRG_TEN;
VAR NUM: INTEGER;
BEGIN
WRITELN('ENTER THE NUMBER');
READ(NUM);
IF NUM>10 THEN;
WRITELN('NUMBER IS GREATER THAN TEN');
READLN;
END.

In the above program you can see there is a line as 'IF NUM>10 THEN'. This shows the condition that is need to be proved. The user will see as'NUMBER IS GREATER THAN TEN' if the condition is fulfilled.  But there is a disadvantage of using this case. The disadvantage is the user can't see anything if the condition is not fulfilled. You can learn how to use the  IF/THEN/ELSE/ENDIF case in my next article.

Saturday, March 5, 2016

Download turbo pascal free

Here you can download turbo pascal


didn't you found turbo pascal that suits your system ?
visit this site to download turbo pascal






http://turbo-pascal-7-for-windows7-8-8-1-by-tec.software.informer.com/download/

Friday, March 4, 2016

START PROGRAMING

                          let's start programing




  • First insert "program" then type name of your program and insert ';' mark(';' mark represent the ending of a line)
                               eg:  program add_num;

  • Then name Variables and Constants in your program.
                                eg: var num:integer;
                                      const pi=22/7;

  • Then type 'begin' to start the program. your program must be written between 'begin' and 'end'.
  • Try the following program.

 program num_add; 
var num1,num2,sum:integer; 
beginwrite('Enter your first number'); 
read(num1); 
write('Enter your second number'); 
read(num2); 
sum:=(num1+num2); 
writeln(sum); 
readln(sum); 
end.

  • In the above program you can see three variables.they are num1, num2, and sum.you have to add as integer after them because they are integers.
                            all integers                   :integer
                            decimal numbers         :real
                            English characters       :char
                            words/sentences          :string
  • The word 'write' is used to show it to the user. The word 'read' is used to understand the computer about the entered thing.
        eg: if you type write('my first program') the user of your program will see it as 'my first                             program'.
              according to the above program if you enter a number as your first number the                                     computer will read it as 'num1' .Therefor it must be a variable you introduced before.                           (if you enter a character program will not work)
  • Same thing happens in the second number too. The computer read the number you enter second as 'num2'.
  • Then computer add the numbers you entered. then a new variable is formed as 'sum'. finally user can see the 'sum' in the pascal window. 



Wednesday, March 2, 2016

introduction to pascal

                             Introduction to pascal

pascal is programing language which is used world wide.you can use pascal to complete task with using your computer.some features of pascal is given  below.

  •  No case sensitive
  • There should not be any space between words.
  • following characters should not be included in an identifier. 􀀃􀀃􀀃􀀃􀀃􀀃􀀃􀀃􀀃􀀃􀀃􀀃@ ! ~ # $ ?􀀃􀀃
  • use of meaningful terms for identifiers can make program easily understand
                                         eg: SUM, LST_NAME, NUM1