1#include <stdio.h>
2#include <string.h>
3int main()
4{
5 char tab[1000];
6 int d = 0;
7
8 printf("enter the string :");
9 gets(tab);
10
11 while (tab[d] != '\0'){
12 d++;
13 }
14 for (int i=0;i<1000;i++){
15 if(tab[i]==' '){
16 d--;
17 }
18 }
19
20 printf(" the length of the string: %d\n", d);
21
22 return 0;
23}