Add to Favorites    Make Home Page 2727 Online  
 Language Categories  
 Our Services  

Home » COBOL Home » General Programs Home »

A D V E R T I S E M E N T

Search Projects & Source Codes:

Title
Author sandeep kumar singh
Author Email sandeep.ks [at] ness-gsg.com
Description A field named STRING-1 contains 30 characters. (/) or (.)indicates the end of a word. this program finds out the total no of words
in STRING-1 and length of the individual words
Category COBOL » General Programs
Hits 381687
Code Select and Copy the Code
Code : * ************************************************************************** **** * * A field named STRING-1 contains 30 characters. (/) or (.) indicates * * * the end of a word. this program finds out the total no of words in * * * STRING-1 and length of the individual words. * * ************************************************************************** **** IDENTIFICATION DIVISION. PROGRAM-ID. EX-11. ENVIRONMENT DIVISION. DATA DIVISION. WORKING-STORAGE SECTION. 01 STRING-1 PIC X(30). 01 WORD-COUNT PIC 99 . 01 WORD-LEN PIC 99 COMP-3. 01 TEMP1 PIC 99 COMP-3. 01 TEMP2 PIC 99 COMP-3. 01 TEMP3 PIC 99 COMP-3. 01 SLNO PIC 99 VALUE 1. PROCEDURE DIVISION. PROGRAM-START. INITIALIZE TEMP2. DISPLAY "ENTER THE STRING (30 CHARACTERS ONLY) :" WITH NO ADVANCING . ACCEPT STRING-1. INSPECT STRING-1 REPLACING ALL "/" BY ".". INSPECT STRING-1 TALLYING WORD-COUNT FOR ALL ".". DISPLAY "THERE ARE " WORD-COUNT " WORDS IN YOUR GIVEN STRING ". DISPLAY " WORD LENGTH". PERFORM FIND1 UNTIL SLNO > WORD-COUNT. PROGRAM-END. STOP RUN. FIND1. INSPECT STRING-1 TALLYING TEMP1 FOR CHARACTERS BEFORE INITIAL "." REPLACING FIRST "." BY "~". SUBTRACT TEMP2 FROM TEMP1 GIVING TEMP3. IF SLNO NOT = 1 SUBTRACT 1 FROM TEMP3. DISPLAY SLNO " WORD " TEMP3. MOVE TEMP1 TO TEMP2. MOVE ZERO TO TEMP1. ADD 1 TO SLNO.

Related Source Codes

Script Name Author
COBOL ON-SCREEN CALCULATOR (Mini Project) Stephen Rendell
Learn Cobol in a Day C.KUMARESAN
my atm (Mini Project) sandeep kumar singh
Merge Two Files. Rakshith
Naveen Chandran P.K
Program of USSR naval stock list Jai Ganesh
PRIME NUMBER Grace Hill
Date Difference in Mainframe COBOL Muruganandham
Sequential File - Health Care C.KUMARESAN
Task for the day program. Rama Murthy M
FIBONACCI series Abir Pathak
PRIME NUMBER Grace Hill
Harmonic Series Abir Pathak
Cobol sequential file program. b.s.prakash
Introduction to COBOL. B.S.prakash

A D V E R T I S E M E N T




Google Groups Subscribe to SourceCodesWorld - Techies Talk
Email:

Free eBook - Interview Questions: Get over 1,000 Interview Questions in an eBook for free when you join JobsAssist. Just click on the button below to join JobsAssist and you will immediately receive the Free eBook with thousands of Interview Questions in an ebook when you join.

New! Click here to Add your Code!


ASP Home | C Home | C++ Home | COBOL Home | Java Home | Pascal Home
Source Codes Home Page

 Advertisements  

Google Search

Google

Source Codes World.com is a part of Vyom Network.

Vyom Network : Web Hosting | Dedicated Server | Free SMS, GRE, GMAT, MBA | Online Exams | Freshers Jobs | Software Downloads | Interview Questions | Jobs, Discussions | Placement Papers | Free eBooks | Free eBooks | Free Business Info | Interview Questions | Free Tutorials | Arabic, French, German | IAS Preparation | Jokes, Songs, Fun | Free Classifieds | Free Recipes | Free Downloads | Bangalore Info | Tech Solutions | Project Outsourcing, Web Hosting | GATE Preparation | MBA Preparation | SAP Info | Software Testing | Google Logo Maker | Freshers Jobs

Sitemap | Privacy Policy | Terms and Conditions | Important Websites
Copyright ©2003-2024 SourceCodesWorld.com, All Rights Reserved.
Page URL: http://www.sourcecodesworld.com/source/show.asp?ScriptId=926


Download Yahoo Messenger | Placement Papers | Free SMS | C Interview Questions | C++ Interview Questions | Quick2Host Review