in Education by
C program to count number of words in a sentence including comma tabs Select the correct answer from above options

1 Answer

0 votes
by
 
Best answer
/* * C Program to Count Number of Words in a given Text Or Sentence */#include #include void main(){ char s[200]; int count = 0, i; printf(“enter the string\n”); scanf(“%[^\n]s”, s); for (i = 0;s[i] != ‘\0’;i++) { if (s[i] == ‘ ‘) count++; } printf(“number of words in given string are: %d\n”, count + 1);}

Related questions

0 votes
    write a program to enter a sentence and check if it contains palindrome words or not. if yes then count and ... present. Java class 10 Select the correct answer from above options...
asked Dec 31, 2021 in Education by JackTerrance
0 votes
    Complete the sentence by choosing TWO WORDS either of which will fit the blank. The two words must both produce a ... on his bike. Select the correct answer from above options...
asked Nov 27, 2021 in Education by JackTerrance
0 votes
    5. Write a program to count the number of spaces, upper case and lower case characters in a string, where the ... entered by the user Select the correct answer from above options...
asked Nov 29, 2021 in Education by JackTerrance
0 votes
    Write a program to take a string parameter (st) of a function reversing(). Reverse the sentence in sucha way so ... None Hate All Love Select the correct answer from above options...
asked Dec 19, 2021 in Education by JackTerrance
0 votes
    Write a program in JAVA to input a sentence reverse every word and print . Please answer someone. Select the correct answer from above options...
asked Dec 13, 2021 in Education by JackTerrance
0 votes
    write a Java program to input 10 non-zero numbers in an array and display the count of even and odd numbers. URGENT! Select the correct answer from above options...
asked Dec 31, 2021 in Education by JackTerrance
0 votes
    icse class 10 students plzz answer this write a program to check two words are in anagram (anagram is set of ... the letters are same Select the correct answer from above options...
asked Dec 19, 2021 in Education by JackTerrance
0 votes
    icse class 10 students plzz answer this write a program to check two words are in anagram (anagram is set of ... the letters are same Select the correct answer from above options...
asked Dec 18, 2021 in Education by JackTerrance
0 votes
    Identify the Indirect object in the following sentence “The teacher gave us homework” (a) The Teacher (b) gave (c) US (d) homework Select the correct answer from above options...
asked Dec 22, 2021 in Education by JackTerrance
0 votes
    60. “What do you think”?Recognise the type of sentence. (A) optative (B) negative (C) positive (D) interrogative Select the correct answer from above options...
asked Dec 5, 2021 in Education by JackTerrance
0 votes
    58. “May You Live long”.Recognise the type of sentence. (A) positive (B) interrogative (C) optative (D) negative Select the correct answer from above options...
asked Dec 5, 2021 in Education by JackTerrance
0 votes
    60. “What do you think”?Recognise the type of sentence. (A) optative (B) negative (C) positive (D) interrogative Select the correct answer from above options...
asked Nov 26, 2021 in Education by JackTerrance
0 votes
    58. “May You Live long”.Recognise the type of sentence. (A) positive (B) interrogative (C) optative (D) negative Select the correct answer from above options...
asked Nov 26, 2021 in Education by JackTerrance
0 votes
    “Open the window”.Recognise the type of sentence. (A) optative (B) imperative (C) negative (D) positive Select the correct answer from above options...
asked Nov 26, 2021 in Education by JackTerrance
0 votes
    60. “What do you think”?Recognise the type of sentence. (A) optative (B) negative (C) positive (D) interrogative Select the correct answer from above options...
asked Nov 25, 2021 in Education by JackTerrance
...