i am a beginner to c programming language...
can anyone plz explain "why scanf() statement is not working after its use in the condition part of the while loop" as in the code is in attachment.
Code:#include <stdio.h> int main() { int n[50], num; int i = 0, c = 0; printf("Enter numbers (At end enter any letter): "); while (scanf("%d", &n[i])) { i++; } printf("\n\tEnter a number: "); scanf("%d", &num); //This statement doesn't execute printf("\n\tnum = %d", num); return 0; }



1Likes
LinkBack URL
About LinkBacks



