// editor1
#include<stdio.h>
#include<string.h>
int lengthoflastword(char *s);
int len = strlen(s){
    int count =0;
    int i = len-1;
    while(i>=0 && s[i] ==' '){
        i--;
    }
    while(i>=0 && s[i] !=' '){
        count++;
        i--;
}
return count;
}
int main (){
    char sentence[100];
    printf("Enter a sentence:");
    fgets(sentence,sizeof(sentence),stdin);
    sentence[strcspn(sentence,"\n")]=0;
    int lastwordlength = lengthoflastword(sentence);
    printf("Length of the word: %d\n",lastofwordLength);
    return 0;
}