Question: Can anyone change the while loop to for loop In C programming please Project 13 Global Scope) 67 Declares variable char LineoftMAX sIzEJ; char
Project 13 Global Scope) 67 Declares variable char LineoftMAX sIzEJ; char words[MAX SIZE]; int occured; int L e; char Choi; int ode; //opens file FILE fp fopen( DataFile.txt", "r"); 77 do printf( Enter a word you want to search for: scanf(Txis Words); rewind (fp); 85 while (fgets(Lineof, sizeof(Lineof), fp) 1. MULL) 87 //Line length Lineof [strlen(Lineof) 1] 'We'; Linehumber++; occured occured search current line(Lineof, words) if (occured I. e) Print VnFound Xs xd times on line xdin", Words, occured, LineNumber I print VnThe Line is: Vn xs", Lineof); od occured Old if (odd e) printf( InThe string .xs. was found a total of .xd" times in the puzzle. Words, 0d) else if (od e) printf VnThe string Xs was NOT found in the puzzle Words)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
