From 1b2260be776474d3799743027e0761bf9acb60d0 Mon Sep 17 00:00:00 2001 From: Arsenic <54987647+Arsenic-ATG@users.noreply.github.com> Date: Thu, 15 Apr 2021 11:24:06 +0530 Subject: [PATCH] Fix typo in comments ./strings/c-or-cpp/count-words.c:47: returing ==> returning --- strings/c-or-cpp/count-words.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/strings/c-or-cpp/count-words.c b/strings/c-or-cpp/count-words.c index 82705d35..47437b7d 100644 --- a/strings/c-or-cpp/count-words.c +++ b/strings/c-or-cpp/count-words.c @@ -1,7 +1,7 @@ /* Program to find the total numbers of words in a sentence */ -#include -#include -#include +#include +#include +#include //Function which calculate and return total numbers of words int count_words(char *sen) @@ -33,6 +33,7 @@ the last index no. contain null and null is not alphabet so we not need to treat } return word; } + //driver code int main() { @@ -44,7 +45,7 @@ int main() if(sen==NULL) { fprintf(stderr, "malloc() failed to allocate memory\n"); - // returing 1 to tell that the program didn't run successfully + // returning 1 to tell that the program didn't run successfully return 1; } printf("Enter a sentence: "); @@ -57,6 +58,7 @@ int main() //printing the total words printf("Total number of words: %d",res); } + /* Test case 1: Input: Enter a sentence: DSA is a Important Topic