Skip to Main Content
Programming and Data Structures
book

Programming and Data Structures

by Ashok Kamthane
August 2009
Intermediate to advanced content levelIntermediate to advanced
604 pages
21h 39m
English
Pearson India
Content preview from Programming and Data Structures
Loop Control Statements 127
void mainO
{
in t i=0;
c l r s c r ();
fo r ( ; ; )
I
printf ("%5d",i++);
if (i--1l)
goto stop;
i
stop:;
I
QJJJFUJ-i
0123456789 10
Explanation The for ( ; ; ) statement is used in the above program. This statement allows
execution of the body of the loop infinite times. To exit from the infinite for loop, goto statement
is used. After satisfying the test condition goto statement is executed which terminates the program.
6.8 Write a program to count numbers between 1 to 100 not divisible by 2,3 and 5.
# include <stdio.h>
# include <conio.h>
void mainO
{
in t x ,ca 0 ;
c l r s c r ( );
printf ("\n Numbers fro
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning Data Structures and Algorithms

Learning Data Structures and Algorithms

Rod Stephens
Data Structures and Algorithms in C++, Second Edition

Data Structures and Algorithms in C++, Second Edition

Michael T. Goodrich, Roberto Tamassia, David M. Mount

Publisher Resources

ISBN: 9789332506343