R while loop
A while loop is a type of control flow statements which is used to iterate a block of code several numbers of times. The while loop terminates when the value of the Boolean expression will be false.
In while loop, firstly the condition will be checked and then after the body of the statement will execute. In this statement, the condition will be checked n+1 time, rather than n times.
The basic syntax of while loop is as follows:
Example 2: Program to find the sum of the digits of the number.
Example 3: Program to check a number is palindrome or not.
Example 4: Program to check a number is Armstrong or not.
Example 5: program to find the frequency of a digit in the number.