#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#define SIZE 19
int main()
{
char name[SIZE];
int x;
int i;
printf("Enter your name: ");
scanf("%s", &name);
for (i = 1; name[i] != '\0'; i++);
printf("Are you sure your name is: ");
for (x = i - 1; x >= 0; x--)
printf("%c", name[x]);
}
On line 9 why do we need to have a semicolon there after the For statement? Without the semicolon the program prints "Are you sure your name is: Are you sure your name is: ".
EDIT: People don't like duplicate questions so here I am making it different - What do you think is the problem, why isn't it working???? [SOLVED]