Already have an account? Get multiple benefits of using own account!
Login in your account..!
Remember me
Don't have an account? Create your account in less than a minutes,
Forgot password? how can I recover my password now!
Enter right registered email to receive password!
Example of If- else statement
Illustration:
IF QUANTITY IS NUMERIC AND QUANTITY IS POSITIVE
MOVE ZERO TO ERROR-CODE. COMPUTE SALES VALUE=QUANTITY*RATE
ELSE MOVE 1 TO ERROR -CODE
MOVE ZERO TO SALES-VALUE
The particular condition tests whether or not the present value of the data name QUANTITY is numeric as well as positive. If the condition is true then ERROR-CODE is set to zero and SALES-VALUE is computed by multiplying the QUANTITY by RATE. On the other hand, when the condition is FALSE, then ERROR CODE is set to 1 and SALES-VALUE is set to zero. In either situation the control goes implicitly to the next statement after this IF sentence. The above sentence is equal to the following flowchart.
PROGRAM FOR IF : We have to write a program to check whether the given number is ODD or EVEN. Identification division. Program- id. Ifst. Environment division.
DELETE STATEMENT: The format of the delete statement is as shown below: DELETE file-name RECORD [ ; INVALID KEY imperative-statement ] Whenever the ACCESS MOD
Example of Nested if statement: Illustration: Consider the following sentence The nested IF sentence holds two IFs and one ELSE. The IF-ELSE couple has been marke
ON SIZE ERROR OPTION: Whenever a size error occurs, the contents of the result field after the operation is unpredictable. Though, the processing is not-terminated and the co
PROGRAM FOR CONDITION NAMES: We have to write a simple program to demonstrate Condition names usage. identification division. program- id. environment division.
PROCEDURE DIVISION statements for the relative files: The statements OPEN, CLOSE, READ, WRITE and REWRITE that are available for sequential files are also available for the re
Buffers: The Modern computers are able of handling I-O operations independent of the CPU by means of the hardware termed as data channel. For illustration, if two buffers a
DISPLAY STATEMENT: The function of the DISPLAY statement is just opposite to that of the ACCEPT statement. It is used to display the low-volume results on the operator's co
REDEFINES CLAUSE: At times it may be found that two or more storage regions defined in the DATA DIVISION are not in use concurrently. In such situations only one storage regio
Name the divisions in a COBOL program are given below DENTIFICATION DIVISION DATA DIVISION ENVIRONMENT DIVISION PROCEDURE DIVISION.
Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!
whatsapp: +91-977-207-8620
Phone: +91-977-207-8620
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd