Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Looking for Ideas.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Mounika Nemani

New User


Joined: 25 May 2018
Posts: 5
Location: India

PostPosted: Mon Jul 23, 2018 1:51 pm    Post subject: Looking for Ideas.
Reply with quote

Hi,

This may be simple. pardon me for asking though..
I want to know different logical ways on how to code a cobol program(logic part) to achieve the below output in sysout.

Code:
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5


Thanks
Mounika
Back to top
View user's profile Send private message

enrico-sorichetti

Senior Member


Joined: 14 Mar 2007
Posts: 10515
Location: italy

PostPosted: Mon Jul 23, 2018 3:05 pm    Post subject: Reply to: Looking for Ideas.
Reply with quote

the logic of an algorithm does NOT depend on the programming language!
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2090
Location: UK

PostPosted: Mon Jul 23, 2018 3:08 pm    Post subject: Reply to: Looking for Ideas.
Reply with quote

If this is a "classroom" exercise then you should really join the beginners forum which is for newbies (to a subject) and students.

There are different ways to do this:
brute force:
Code:
display 1
display 1 2
etc

more sophisticated:
Code:
initialise a table to 1, 2, etc
loop 1 to number of entries
   loop 1 to current outer loop vcontrol value
      display table item(inner loop control value)
   end inner loop
end outer loop

and other ways
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts File Contention Ideas (Batch & Fi... jpdeshai SYNCSORT 35 Sat Mar 22, 2014 3:29 am
No new posts Db2 tools , missing feature , Ideas sushanth bobby DB2 2 Fri Aug 31, 2012 1:23 pm
No new posts Share your ideas About Mainframe testing jagdishmudiraj Testing & Performance analysis 6 Thu Nov 23, 2006 4:51 pm
No new posts Kids' Ideas About Love priya General Talk & Fun Stuff 0 Sun Feb 27, 2005 11:01 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us