// Function to count the number of words.
int i=0, sum=0, n=0;
arr[i] = ch;
if (ch == ' ')
sum = sum + i;
i = 0;
cout << "Total no. of words : " << n;
step by step explanation:
1.the header file "iostream.h" is used to include the function cin and cout.
2.the header file"conio.h"is used to include the function like getch and clrscr.
3.void calculate is also a void type function.
4.while is a conditional statement it is used to check the condition.
5.void main is also a void type function it is worked under the curley brackets.