10th Mar 2022, 11:52 AM
Abhay mishra
Abhay mishra - avatar
3 Antworten
0
Initialize variable i outside the loop, not inside it
10th Mar 2022, 11:56 AM
Abhishek Tandon
Abhishek Tandon - avatar
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 ; }
10th Mar 2022, 11:56 AM
Nima
0
Thanks infinity sir and nima sir 😊
10th Mar 2022, 11:58 AM
Abhay mishra
Abhay mishra - avatar