22ADS108 Lecture Notes - Lecture 3: In C, Flowchart, For Loop

8 views18 pages

Document Summary

Explain while loop in c with flow chart and example. Loop structures while loop: a loop is used for executing a block of statements repeatedly until a given condition returns false. Increment can be done before or after the execution of the statement(s) Program to print the number from 1 to 10 using while loop. #include int main() int i=1; while(i<=10) printf("%d\n",i); i=i+1; Program to print hello world 10 times using while loop. #include int main() int i=1; while(i<=10) printf("hello world!\n"); i++; return 0; Explain for loop in c with flow chart and example. For loop: a for loop is a more efficient loop structure in c" programming. In c programming language for loop is a statement which allows code to be repeatedly executed. It contains 3 parts for loop in c language is used to iterate the statements or a part of the program several times.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents

Related Questions