Course Content
Computer Science 2010 : Olevel : Free Trail Course

In the input stage of programming, the declaration of variables precedes the acquisition of user input.

Variables are declared to reserve memory space for storing the data that will be provided by the user.

This declaration informs the program about the type and name of the variable that will hold the input data. Once the variables are declared, the program prompts the user with a message, typically indicating the type of input expected or providing instructions.

Following the prompt, the program waits for the user to input data, which is then captured using an input function or similar mechanism.

This input is then assigned to the corresponding variables declared earlier, allowing the program to utilize the user-provided data in subsequent stages of execution.

Proper declaration and handling of variables during the input stage ensure that the program can effectively interact with users and process the input data as intended.

Follow these examples

Example 1:

DECLARE PRODUCTNAME : STRING 

OUTPUT “ENTER PRODUCT NAME : “

INPUT PRODUCTNAME

Example 2 :

DECLARE PRODUCTQTY : STRING 

OUTPUT “ENTER PRODUCT QTY : “

INPUT PRODUCTQTY