Question: Please be accurate with your work. Please fix my (C) program. I will post the directions, example of the output, and my program with the
Please be accurate with your work.
Please fix my (C) program. I will post the directions, example of the output, and my program with the current grade(3/6) of my program. My program is almost complete, but I need someone to modify it so it dosn't use gets(), I need it to use fgets().
Here are the directions:

Here is my program that needs fixed:
#include
#include
//Returns the number of characters in usrStr
int GetNumOfCharacters(const char usrStr[]) {
/* Type your code here. */
int count = 0;
int i = 0;
for(i=0; i count++; return count; } void OutputWithoutWhitespace(const char usrStr[]){ printf("string with no whitespace: "); int i = 0; for(i=0; i if(usrStr[i] != ' ' && usrStr[i] != '\t') printf("%c", usrStr[i]); printf(" "); } int main(void) { /* Type your code here. */ char usrStr[50]; printf("Enter a sentence or phrase: "); gets(usrStr); printf(" You entered: %s ", usrStr); printf("Number of characters: %d ", GetNumOfCharacters(usrStr)); OutputWithoutWhitespace(usrStr); return 0; } The grading of my program submission is here: ( As you can see, 4, 5, and 6 are incorrect. I need these to be correct. Please remember to include fgets() instead of gets(). ) (Note: 4, 5, and 6 are incorrect by one number, please fix this) Thanks!! 


Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
