*However, there are multiple errors in the given C program. Please correct complier errors and use gdb to debug the program and find out the errors.*** Question: Please write down the line numbers...



PLEASE SEE ATTACHMENT. THIS IS FOR SYSTEM-LEVEL


*However, there are multiple errors in the given C program. Please correct<br>complier errors and use gdb to debug the program and find out the errors.***<br>Question: Please write down the line numbers containing the errors and show how<br>to correct them.<br>(Note: you do not need to write down the commands you issued in gdb.)<br>Part 2:<br>You are given a C program
int main() { 14 .nt lettera: int words; char character: 7 printf("Enter a Sentence: "); 10 while ( (character=getchar()) != \n) { if (character != ' '){ ifllapace) ( words++; 11 www .c 13 14 15 зрасе-1; 16 17 letters++; 18 19 lelse space = 0; 20 21 } 22 printf("Average word length : $.1f", letters/words); 23 24 return 0; 25 ddd ddD 11 11 222 222 "/>
Extracted text: *However, there are multiple errors in the given C program. Please correct complier errors and 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.) 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.4 For simplicity, the program considers a punctuation mark to be part of the word to which it is attached. And it displays the aveage word length to one decimal place. #include int main() { 14 .nt lettera: int words; char character: 7 printf("Enter a Sentence: "); 10 while ( (character=getchar()) != \n) { if (character != ' '){ ifllapace) ( words++; 11 www .c 13 14 15 зрасе-1; 16 17 letters++; 18 19 lelse space = 0; 20 21 } 22 printf("Average word length : $.1f", letters/words); 23 24 return 0; 25 ddd ddD 11 11 222 222

Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here