This is a simple C program that explains do while loop.Before the loop ends there two scanf ./ I am really confused with the one " scanf("%d",&dummy); ". The program will not run as expected wihtout this line. So, I believe this line act as a some sort of placeholder to create a space to take input for chat. But I am not sure about this and how actually it works
#include<stdio.h>
#include<stdlib.h>
void main ()
{
char c;
int choice,dummy;
do{
printf("\n1. Print Hello\n2. Print Javatpoint\n3. Exit\n");
scanf("%d",&choice);
switch(choice)
{
case 1 :
printf("Hello");
break;
case 2:
printf("Javatpoint");
break;
case 3:
exit(0);
break;
default:
printf("please enter valid choice");
}
printf("do you want to enter more?");
scanf("%d",&dummy); //This part confuses me
scanf("%c",&c);
}while(c=='y');
}