1. Home
  2. /
  3. Cobol
  4. /
  5. Fibonacci Sequence

Fibonacci Sequence - Cobol Typing CST Test

Loading…

Fibonacci Sequence — Cobol Code

Generates first 10 Fibonacci numbers.

       IDENTIFICATION DIVISION.
       PROGRAM-ID. FibonacciProgram.
       DATA DIVISION.
       WORKING-STORAGE SECTION.
       01 N      PIC 9(2) VALUE 10.
       01 A      PIC 9(5) VALUE 0.
       01 B      PIC 9(5) VALUE 1.
       01 TEMP   PIC 9(5) VALUE 0.
       01 COUNTER PIC 9(2) VALUE 1.

       PROCEDURE DIVISION.
       DISPLAY A
       PERFORM VARYING COUNTER FROM 2 BY 1 UNTIL COUNTER > N
           ADD A TO B GIVING TEMP
           DISPLAY B
           MOVE B TO A
           MOVE TEMP TO B
       END-PERFORM
       STOP RUN.

Cobol Language Guide

COBOL (Common Business-Oriented Language) is a high-level, English-like programming language designed for business applications, financial systems, batch processing, and large-scale enterprise data operations. Known for reliability, readability, and long-term stability.

Primary Use Cases

  • ▸Banking and financial transaction systems
  • ▸Payroll and HR systems
  • ▸Insurance policy and claims processing
  • ▸Government mainframe workloads
  • ▸Batch data processing
  • ▸Large-scale enterprise reporting

Notable Features

  • ▸English-like syntax for clarity
  • ▸Exceptional stability for long-running systems
  • ▸Massive legacy ecosystem in enterprises
  • ▸Strong support for structured data processing
  • ▸Designed for business rules rather than hardware

Origin & Creator

Developed in 1959 by CODASYL (Conference on Data Systems Languages), with major contributions from Grace Hopper and the US Department of Defense.

Industrial Note

COBOL still powers core banking, insurance, payroll, and government systems worldwide - often handling billions of daily transactions in mission-critical environments.

More Cobol Typing Exercises

COBOL Counter and Theme ToggleCOBOL Simple AdditionCOBOL FactorialCOBOL Array SumCOBOL Max of Two NumbersCOBOL Reverse StringCOBOL Even Numbers FilterCOBOL String Concatenation

Practice Other Languages

CReactPythonC++RustTypeScriptKotlinPHPJavaC#RubyMqlCqlN1qlCypher