Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

In c, I want to input multiple line of text, like this: ahxjehxx Fjdbcjdjs Dhshs

ID: 3743515 • Letter: I

Question

In c, I want to input multiple line of text, like this: ahxjehxx Fjdbcjdjs Dhshsjsjs Dhdhcdj
My program will end when it meets , and count how many lines? For this question is 4 and give me the number of how many characters.
Thanks In c, I want to input multiple line of text, like this: ahxjehxx Fjdbcjdjs Dhshsjsjs Dhdhcdj
My program will end when it meets , and count how many lines? For this question is 4 and give me the number of how many characters.
Thanks ahxjehxx Fjdbcjdjs Dhshsjsjs Dhdhcdj
My program will end when it meets , and count how many lines? For this question is 4 and give me the number of how many characters.
Thanks

Explanation / Answer

#include #include int main() { char str[1000]; int lines = 0, total = 0; while(scanf("%s", str) != EOF) { total += strlen(str); lines++; } printf("Number of lines = %d ", lines); printf("Number of characters = %d ", total); return 0; }
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote