string length program c
#include <stdio.h>
#include <string.h>
int main()
{
char tab[1000];
int d = 0;
printf("enter the string :");
gets(tab);
while (tab[d] != '\0'){
d++;
}
for (int i=0;i<1000;i++){
if(tab[i]==' '){
d--;
}
}
printf(" the length of the string: %d\n", d);
return 0;
}