/************************************************************************
*																		*
* ders 10 ornekleri - Deniz Demiray										*
* cumleyi kelimelerine ayiran program									*
* derlemek icin gcc -o program_ismi 5.c									*
*																		*
************************************************************************/

#include <stdio.h>
#include <stdlib.h>

int main()
{
	char sentence[50], *word = sentence;
	int i = 1;
	
	printf("Enter a sentence:\n");
	gets(sentence);
	
	printf("The sentence: %s\n", sentence);
	
	printf("%d. word: ", i);
	i++;
	
	while (*word != '\0'){
		if (*word == ' ') {
        printf("\n%d. word: ", i);
		i++;
        }
        else 
        printf("%c", *word);
		
        word++;
	}
	printf("\n");
	
	system("pause");
	
	return 0;	
}
