Program 85:
This is same as the
Program 82:To count number of times a letter repeated in sentence except here we are calculating number of times a space is repeated.
Output:
#include<stdio.h> #include<string.h> main() { int i,spaces=0; char str[100]; printf("Enter a sentence to know number of white spaces\n"); gets(str); for(i=0;i<strlen(str);i++) { if(str[i]==' ') { spaces++; } } printf("%d\n",spaces); }Explanation:
This is same as the
Program 82:To count number of times a letter repeated in sentence except here we are calculating number of times a space is repeated.
Output: