I am tasked with creating a program that uses functions to take a user input word, store it in an array, and then display this word, the word in reverse, the word vertically, then the word reverse and vertical. For example:
Input:
array
Output:
array
----
yarra
----
a
r
r
a
y
------
y
a
r
r
a
So far, I have the code to store and display the word, I am just wondering what the best way to display this in reverse would be? The code so far:
#include <stdio.h>
void primaryFunction()
{
char arrA[100] = {0};
int n;
//unsigned char ch;
unsigned int i = 0;
printf("Enter Your Word:\n");
for(i = 0; i<n; i++)
{
scanf("%c", &arrA[i]);
printf("\n%c",arrA[i]);
printf("%c",arrA[i]);
}
}
int main(void)
{
primaryFunction();
}
Any guidance can help. Thank you!!