/************************************************************************
*																		*
* ders 10 ornekleri - Deniz Demiray										*
* char dizi ornegi 2, & olmayan scanf ve char ptr ile string yazimi		*
* derlemek icin gcc -o program_ismi 4.c									*
*																		*
************************************************************************/

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

int main()
{
	char word[15], *ptr;
	printf("Enter a word:\n");
	scanf("%s", word);   //gets(word); 
	printf("%s\n", word);
	
	ptr = word;
	
	while(*ptr != '\0'){    //for (ptr = word; *ptr != '\0'; ptr++)
        printf("%c\n", *ptr);
	    ptr++;
     }
	    
	printf("\n");
    	
	while (ptr != word)  {
		ptr--;
        printf("%c\n", *ptr);
	  }
     
    system("pause");
    
	return 0;
}
