logo
logo
AI Products 
Leaderboard Community🔥 Earn points

C Programming while and do...while Loop

avatar
Tech Mekrz
collect
0
collect
0
collect
1
C Programming while and do...while Loop

The syntax of a while loop is:

where, testExpression checks the condition is true or false before each loop.

If the test expression is true (nonzero), codes inside the body of while loop are exectued.

The process goes on until the test expression is false.

// Program to find factorial of a number

// For a positive integer n, factorial = 1*2*3...n

collect
0
collect
0
collect
1
avatar
Tech Mekrz