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
FILE-CONTROL: The FILE-CONTROL paragraph names each and every file and identifies the first medium through file control entries. The basic format of a file control entry is gi

PROGRAM FOR MULTIPLY VERB: We have to write a simple program to elaborate MULTIPLY verb. You can also use the edit characters in the program. Identification division. Pr

Occurs Clause: Let us establish tables with the help of an illustration. Assume that there are ten different types of income-tax rates that are read from some input medium and

TO WRITE A QUADRATIC EQN ROOTS ARE COMPLEX IN COBOL PROGRAM

WRITE Statement:      The WRITE statement for a relative file has the format which is as shown below.          WRITE  record-name   [ FORM   identifier ]

MULTIPLY VERB:   The Multiply Verb causes one or more multiplicands to be multiplied by the multiplier and to store the products. The form of the MULTIPLY verb is as shown be

Data Names and Identifiers:   The Data name provides reference to the storage space in the memory where the real value is stored. This value takes part in the operation whene

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

RULES FOR OCCURS CLAUSE: The rules apply for the OCCURS clause and the subscripts are as shown below. (1) The integer in the OCCURS clause should be a positive integer.

Comparison of Nonnumeric Operands: A nonnumeric operand can be compared to the other nonnumeric operand according to the rules as shown below: (i) Fields of Equal Sizes: