Skip to content

Latest commit

 

History

History
28 lines (14 loc) · 1.23 KB

README.md

File metadata and controls

28 lines (14 loc) · 1.23 KB

Loop-in-CPP

##AIM: To study different loops in C++

##THEORY:

In programming languages, a loop is used to achieve the task of executing a block of instructions multiple times.The loop is run till the desired condition is reached.C++ supports loops such as do,do-while and for loop.

##SYNTAX

1.while loop – First checks the condition, then executes the body.
2.do-while loop – firstly, execute the body then condition check.
3.for loop – firstly initializes, then, condition check, execute body, increment.

Screenshot 2023-10-09 215639

##OUTPUTS

1)do_while-Screenshot 2023-10-01 151534
2)for_loop-Screenshot 2023-10-01 151637
3)number_triangleScreenshot 2023-10-01 151702
4)while-Screenshot 2023-10-01 151618