0
Why the loop is not stopping ?
3 Answers
0
Initialize variable i outside the loop, not inside it
0
move the i out of the loop
#include<stdio.h>
int main()
{
int i ;
char d ;
i = 1 ;
do{
printf("Have you driven car ? y/n \n") ;
scanf("%c" , &d) ;
if(d =='n') {
continue ;
}
printf("You can be vicitim of that murder \n") ;
i++ ;
} while(i <= 3) ;
return 0 ;
}
0
Thanks infinity sir and nima sir đ