Question: Part 2: You are given a C program q2.c as below. This program is used to calculate the average word length for a sentence (a
Part 2: You are given a C program "q2.c" as below. This program is used to calculate the average word length for a sentence (a string in a single line): Enter a sentence: It was deja vu all over again. Average word length: 3.42 For simplicity, the program considers a punctuation mark to be part of the word to which it is attached. And it displays the average word length to two decimal places. 3 int main ) ( ins lesters; int wozds; char cha=acter; printf("Entez a Sentence:); 10 while ((characte r= getchar ( ) ) != 1m){ 13 14 15 16 17 f space) f words++ pace TRUE jelse 19 20 space = rALSE; printf"average word length : , letters/words): 24 return 0 However, there are multiple errors in the given C program. Please use gdb to debug the program and find out the errors. Question: Please write down the line numbers containing the errors and show how to correct them (Note: you do not need to write down the commands you issued in gdb.)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
