reverse string sentence c : i tried to find somthing mach to my needs but i dident.
somone could help me fix my code to sucsses reverse a sentence (from: "my name is" to "is name my" for example).
please without function and pointers.

  

    #include <stdio.h>
    #include <string.h>
    
    void main() {
    	int i = 0, j = 0, end, count=0, sumletters=0;
    	char str[1000], strrev[1000];
    
    	fgets(str, sizeof(str), stdin);//get string from user
    
    	sumletters = strchr(str, '\0') - str - 1;//find the last characters in string
    	while (sumletters) {
    		end = sumletters= strchr(str, '\0') - str - 1;
    		while (str[sumletters] != ' '){ //find the number letters of the last word and enter to counter
    				sumletters--;
    			}
    
    		for (i = 0; sumletters!=end; i++, sumletters++) {//enter every leters from the last word to new string 
    				strrev[i] = str[sumletters + 1];
    				str[sumletters + 1] = '\0';//dros the leters that already copy
    			}
    		
    	}
    
    	puts(str);
    	puts(strrev);
    
    
    }



