While and Do-While in c :- While Loop ek single loop hoti hai. jab condition True hoti hai tab hi Statement execute hote hai.
Do While Me Pahle Program Execute hota hai or bad me condition check hoti Hai | Lekin Do while statement ek bar hi execute hoti hai.
Flow Chart While And Do-While

While Loop in c
Syntax While Loop :-
initial variable declaration;
while(condition)
{
//statements
//increment
}
Example :-
#include <stdio.h>
#include <conio.h>
int main()
{
int number=1;
while(number<=10) //while loop with condition
{
printf("%d\n",number);
number++; // incrementing operation
}
return 0;
}
Output :-
1
2
3
4
5
6
7
8
9
10
Aap Dekh Sakte Hai While Loop ko aap kese istemal kar sakte hai.
Do-While Loop In c
Syntax Do-While Loop
do {
statements
} while (expression);
Example :-
#include<stdio.h>
#include<conio.h>
int main()
{
int num=1; //initializing the variable
clrscr();
do //do-while loop
{
printf("%d\n",num);
num++; //incrementing operation
}while(num<=10);
getch();
return 0;
}
Output :-
1
2
3
4
5
6
7
8
9
10
While and Do-While in c
Dosto mujhe ummed hai ki aap difference between while and do while in Hindi ko acchi tarah se samanj gye honge agar aap ko ye post acchi lage to mere is website ko jarur follow kre or ha agar aap video bhi dekhna chahte hai to aap mere channel ko bhi subscribe kar sakte hai. channel ka link aapko home page par mil jayega |