Hi guys here is what I aim to do :
Create a program which
1. reads in a string of less than 25 characters from the user
2. prints out the string followed by its reverse
i.e. if the user enters "hello", the program should print "helloolleh".
I can do parts 1 and some of part 2 however on my output it only prints "olleh", and It has some other weird box split into 4 with 1 and 0's over the o.
Firstly how do i stop the weird box.
Secondly how do I go about printing the string out and then its reverse:
here is my code:
#include <stdio.h>
#include "simpleio.h"
char array1[26];
int i;
char array2[26];
int main()
{
printf("Please enter string (of 25 characters length): ");
getString(array1,25);
for(i=array1[i]; i>=0; i--)
{
printf("%c",array1[i]);
}
printf("\n");
return 0;
}
Thanks. Please quote when replying.