OK, below is my code (apologies if it's reckless). What i am trying to achieve is:

+Get a string from user
+Print the string backwards
+Take a char from user and print the location of the first instance of that char in the string
+Ask for another char(a) that was in the original string
+Ask for a new char(b) to replace all instances of char(a) with from the original string
+Ask for a new string(not important regarding my problems)
+Print which is greatest in alphabetical order(not important regarding my problems)


OK, and here is what it does so far:

+Gets a string from user
+Prints the string backwards (BUT ON A NEW LINE FOR SOME REASON? Any ideas why?)
+Takes a char from user and prints the location of the first instance of that char in the string. HOWEVER:
It then skips to the next question and instantly assumes an error, then does this same thing for each step until the final step.

Any idea's why it skips like this? It's having a problem that fflush(stdin) is in ''theory'' supposed to fix. (yes i know fflush(stdin) does NOT work, and i have not used it!)

But yeah, my main problems at the moment are the fact that it keeps data in the stream but only after the function where i print the position of the char in the string. My other problem is that it prints the reversed word on a new line.

Any help would be much appreciated.



Code:
#include<stdio.h>
#include<stdlib.h>
#include<string.h>



/* ---- Reversing Function ---- */
void fReverse(char str[])
{
	int x = 0;
	char wordReversed;

	wordReversed = str[x];

	for(x = strlen(str); x >= 0; x--)
	{
		printf("%c", str[x]);
	}
}// ------------------------------



/* --------- First Occurance Function -------- */
void fOccur(char x, char str[])
{
	int p = (int)(strchr(str, x) - str);
	printf("\nPosition of first occurence: %d", (p+1));
}// --------------------------------------------



/* --------- Swap Function- -------- */
void fSwap(char str[], char y, char z)
{


}// -----------------------------------



/* ------- Greatest String Function ------ */
void fGreatest()
{

}// -----------------------------------------



/* ------------------- Main Function -------------------- */
int main(void)
{
	int zz;
	char strOne[20], strTwo[20], chOne, chTwo, chThree;
	char c1BUF[2], c2BUF[2], c3BUF[2];

	zz = 0;


	printf("+++++++++++++++++++++++++++++++++++++++++");
	printf("\n+                                       +");
	printf("\n+      ??????????? ???????????????      +");
	printf("\n+              ??? ???????              +");
	printf("\n+                                       +");
	printf("\n+++++++++++++++++++++++++++++++++++++++++");


	/* ---- Take word and reverse it ---- */
	do
	{
		printf("\n\nEnter a word: ");
		fgets(strOne, 20, stdin); 
		if(strOne[0] != '\n')
		{
			printf("\n    Reversed:");
			fReverse(strOne);
			zz = 0;
		}
		else
		{
			printf("\n     >Incorrect input, please try again.");
			zz = 1;
		}
	}while(zz == 1);
	/* ---------------------------------- */


    printf("\n\n-----------------------------------------\n");


	/* -------- Take char, check for first occurance -------- */
	do
	{
		printf("\nEnter a character from that word:");
		fgets(c1BUF, 2, stdin);
		chOne = c1BUF[0];
		if((chOne != '\n') /*&& ((c1BUF[1] == '\0') || (c1BUF[1] == '\n'))*/)
		{
			fOccur(chOne, strOne);
			zz = 0;
		}
		else
		{
			printf("\n     >Incorrect input, please try again.\n");
			zz = 1;
		}
	}while(zz == 1);
	/* ------------------------------------------------------ */


    printf("\n\n-----------------------------------------\n");
  

	/* ---- Take another char, change all instances in string ---- */
	do
	{
		printf("\nEnter a character in the string to be changed:");
		fgets(c2BUF, 2, stdin);
		chTwo = c2BUF[0];
		if((chTwo != '\n') && ((c2BUF[1] == '\0') || (c2BUF[1] == '\n')))
		{
			zz = 0;
		}
		else
		{
			printf("\n     >Incorrect input, please try again.\n");
			zz = 1;
		}
	}while(zz == 1);

	do
	{
		printf("\nEnter a character to change all instances to:");
		fgets(c3BUF, 2, stdin);
		chThree = c3BUF[0];
		if((chThree != '\n') && ((c3BUF[1] == '\0') || (c3BUF[1] == '\n')))
		{
			printf("\nNew word is:");
			fSwap(strOne, chTwo, chThree);
			zz = 0;
		}
		else
		{
			zz = 1;
		}
	}while(zz == 0);
	/* ----------------------------------------------------------- */


	printf("\n\n-----------------------------------------\n");


	/* ---- Take another string, print greatest ---- */
	printf("\nEnter another string: ");
	scanf("%s", &strTwo);
	printf("\n  Greatest string is:");
	fGreatest();
	/* --------------------------------------------- */


	
	printf("\n\n-----------------------------------------\n");


	return 0;
}// ------------------------------------------------------