I have a code below that asks if the user wants to retry or not. If the user enters no, the program will terminate. My code doesn't work and the loop still runs even if the input is "no"
#include<stdio.h>
int main()
{
char x[5];
do
{
printf("would you like to try again?");
scanf("%s",&x);
}
while(x != "no");
getch(); return 0;
}
I've tried adding a space in the scanf just like for characters to consume the newline but it also doesn't work. sorry for a very noob question.