Learn C Language 

Learn C Programming Language Step By Step. It’s easy to learn c programming language with real-life examples and hands-on. We are trying our best to deliver quality content.

Infinite Loop 

[adinserter name="Block 7"]

Most of the time beginners do a mistake while writing the program and puts the wrong condition while implementing looping statements. As a result of this, control flows inside that loop at an infinite time and that is called an infinite loop.

Although you can form this loop in many ways by just making condition inside the loop always equal to true. The for loop is traditionally used for this purpose.

[et_pb_dmb_code_snippet title=”EXAMPLE” code=”I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxjb25pby5oPgppbnQgbWFpbiAoKQp7CiAgZm9yKCA7IDsgKQogICAgIHsKICAgICAgcHJpbnRmKCJJbmZpbml0ZSBMb29wIik7CiAgICAgIH0KcmV0dXJuIDA7Cn0=” _builder_version=”4.0.9″]I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxjb25pby5oPgppbnQgbWFpbiAoKQp7CiAgZm9yKCA7IDsgKQogICAgIHsKICAgICAgcHJpbnRmKCJJbmZpbml0ZSBMb29wIik7CiAgICAgIH0KcmV0dXJuIDA7Cn0=[/et_pb_dmb_code_snippet][et_pb_dmb_code_snippet title=”EXAMPLE 2″ code=”I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxjb25pby5oPgppbnQgbWFpbiAoKQp7CiAgZm9yKCA7IDsgKQogICAgIHsKICAgICAgcHJpbnRmKCJJIGFtIGVuam95aW5nIFlvdSEiKTsKICAgICAgfQpyZXR1cm4gMDsKfQ==” _builder_version=”4.0.9″]I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxjb25pby5oPgppbnQgbWFpbiAoKQp7CiAgZm9yKCA7IDsgKQogICAgIHsKICAgICAgcHJpbnRmKCJJIGFtIGVuam95aW5nIFlvdSEiKTsKICAgICAgfQpyZXR1cm4gMDsKfQ==[/et_pb_dmb_code_snippet][et_pb_dmb_code_snippet title=”EXAMPLE 3″ code=”I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxjb25pby5oPgppbnQgbWFpbiAoKQp7CiAgZm9yKCA7IDsgKQogICAgIHsKICAgICAgcHJpbnRmKCJLaWxsIE1lIFVzaW5nIEN0cmwrQyIpOwogICAgICB9CnJldHVybiAwOwp9″ _builder_version=”4.0.9″]I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxjb25pby5oPgppbnQgbWFpbiAoKQp7CiAgZm9yKCA7IDsgKQogICAgIHsKICAgICAgcHJpbnRmKCJLaWxsIE1lIFVzaW5nIEN0cmwrQyIpOwogICAgICB9CnJldHVybiAwOwp9[/et_pb_dmb_code_snippet]

In C language when the conditional expression is absent, the compiler assumes the condition is true. You may have an initialization and increment expression, but C programmers more commonly use the for(;;) construct to signify this loop.

How should You Stop This Naughty Loop

You can terminate this loop by pressing Ctrl + C keys together.

Related Contents

for loop   while loop  do-while loop    nested loop

[adinserter name=”Block 7″]

Top Book Suggestion

The two books on C Programming Language that I Personally Recommend. I really loved reading these books. These books are listed for quality content, easy steps, and affordable price. You can get it from Amazon and Flipkart. 

 

Check The Price On Amazon:

1. C Programming Beginner’s Guide

2. Head First C: A Brain-Friendly Guide

Check The Price On Flipkart:

1. Introduction to C Programming 

2. Head First C: A Brain-Friendly Guide

[adinserter block=”6″]

Buy Premium Courses At Lowest Price. Become A Certified Developer Today!

Best Books Selected by Our Experts

Buy Premium Projects At Lowest Price

Ebooks Written by Our Experts

CoursePot.Com

Buy Premium Courses At Lowest Price. Grab Golden Opportunity To Become A Certified Developer Today!

Useful Links

Pin It on Pinterest

Share This