SlideServe
Menu
Préférences
© SlideServe · v2026

Input and Output (2)

tarak avatar
6 diapositives · 229 Views · Sep 30, 2014

Input and Output (2). Input Statement. Input Statement. Read user input from the keyboard Then assign the value read to a variable There are two input statements in Pascal read readln. readln statement. Syntax: readln ( <input list> )

Input and Output (2) - slide 1
01 / 6Input and Output (2)
1 / 17

Télécharger la présentation

Input and Output (2)
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  1. Input and Output (2) Input Statement

  2. Input Statement • Read user input from the keyboard • Then assign the value read to a variable • There are two input statements in Pascal • read • readln

  3. readln statement • Syntax: • readln ( <input list> ) • <input list> could be a single variable or a list of variables separated by commas • All entries in the <input list> must be variable • Input data is read after the user press Enter key

  4. readln statement (cont.) • Example • var Num1, Num2 : integer; • readln ( Num1 ); • readln ( Num2 ); • writeln ( ‘The numbers are ‘, Num1, ‘, ‘, Num2); 5  8  The numbers are 5, 8

  5. Read more than one variable • To read more than one variable in the same row, put more than one variable in the <input list> in the readln statement and separate these variables with commas • Keyboard inputs are separated by blank space, tab or new line

  6. Read more than one variable • If the number of input values is more than the number of variables in <input list>, excess values are ignored • If the number of input values is less than the number of variables in <input list> when user press Enter, it will wait for more input from user.