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

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. include 2 3 int main) int letters; int words; char character 7 printf ("Enter a Sentence: ") while ((character--getchar )) !-n) ( 12 13 if (character !-'') i f (space) 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. include 2 3 int main) int letters; int words; char character 7 printf ("Enter a Sentence: ") while ((character--getchar )) !-n) ( 12 13 if (character !-'') i f (space)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!