Numeric literals - cobol program, COBOL Programming

Numeric -  Literals:

The numeric literal can be created with the help of digits only. It can have a sign (+ or -) and can also have a decimal point. If no sign is specified the literal then it will be taken as positive. The Negative literals are represented by - sign at the left most ends. If no decimal point is used then the literal is clearly an Integer. If a decimal point is used, it should come in between the digits. The maximum number of digits permitted in a numeric literal is compiler dependent.

Examples:

Valid Numeric Literal                       Invalid Numeric Literals

 

.123                                                  ''123'' (valid as nonnumeric literal but

                                                           invalid as numeric literal)

12.5                                                  - 23 (there is a blank space between the

                                                           sign and the first digit 2)

 

 

Posted Date: 10/16/2012 3:32:10 AM | Location : United States







Related Discussions:- Numeric literals - cobol program, Assignment Help, Ask Question on Numeric literals - cobol program, Get Answer, Expert's Help, Numeric literals - cobol program Discussions

Write discussion on Numeric literals - cobol program
Your posts are moderated
Related Questions
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.

Major difference between file and array how does record read from array and file why we are not preparing array for real time

PROGRAM TO FIND INTEREST ON BANK DEPOSITS: We have to write a program to find interest on deposits. The criteria is given below : identification division. program-

RULES OF MOVE VERB:  The Data movement is managed by the rules which are as shown below: (a) The contents of the identifier - 1 or the value of the literal - 1 is moved to

PROGRAM USING OCCURS CLAUSE: We have to write a simple program to demonstrate Occurs Clause. Get the employee details for 3 persons and compute the total salary. identifica

Abbreviation: The Consecutive relational conditions in a compound condition can be abbreviated in many cases as shown: (i) When the subjects in the consecutive relational c

Floating Insertion   The currency symbol ($) can emerge in multiples on the left-hand side of the picture. In this situation the character will be treated in similar way as t

PROGRAM FOR PERFORM - THRU: We have to write a program to elaborate PERFORM ...THRU statement Identification division. Program- id.  Perfthru. Environment division.

RULES FOR SEARCH VERB: The rules apply for the SEARCH verb is as shown below: (1) The SEARCH verb can be applied only to a table that has the OCCURS clause and INDEXED phra

Rules for Simple sort verb: The work file is to be defined by a sort elaboration entry (SD entry).The format of SD entry is as shown below. The rules below should be taken