int p;
int j;
printf("Who is Palpatine?\n");
scanf("%s", &j);
if (j = "Senate")
{
printf("Your number sir?\n");
scanf("%d", &p);
printf("CT %d, the time has come. Execute Order Sixty-Six.\n", p);
}
else
{
printf("Incorrect\n");
}
return 0;
}
I have been testing these lines of code and right now if I write anything in the prompt, it goes through the section where if I said Senate, even if I did not type Senate, and skips my else statement. The example in executed code picture is when I typed in Sen instead of Senate.
Also crossed out sections of the code in the executed code picture do not deal with the question, and my spacing is atrocious.
Thanks and all feedback is appreciated.