You are writing a COBOL program to calculate the total cost of items in a shopping cart. Which type of COBOL variable would you use to store the individual item prices?

  • PIC 9(3) DISPLAY
  • PIC 9(5)V99 COMP-3
  • PIC S9(4) USAGE COMP
  • PIC X(10)
For storing monetary values like individual item prices in a COBOL program, PIC 9(5)V99 COMP-3 is suitable. This usage efficiently represents decimal numbers and ensures accurate calculations.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *