1//While loop, for the largest of two numbers.
2#include <stdio.h>
3int main(){
4 int a, b;
5 printf("Enter Values a and b:\n");
6 scanf("%d %d", &a, &b);
7 while (a < b){
8 printf("%d is greater than %d\n", b, a);
9 printf("Enter Values a and b:\n");
10 scanf("%d %d", &a, &b);
11 }
12 printf("%d is greater than %d\n", a, b);
13
14}
1//This program stops when a number greater than 10 is printed and prints that, value greater than 10
2#include <stdio.h>
3main()
4{
5
6 int a;
7 do
8 {
9 printf("\nEnter your value: ");
10 scanf("%d", &a);
11 } while (a<10);
12 printf("Value greater than 10");
13
14
15}
1#include <stdio.h>
2int main()
3{
4 int j=0;
5 do
6 {
7 printf("Value of variable j is: %d\n", j);
8 j++;
9 }while (j<=3);
10 return 0;
11}