Basically I want to create a program that would have potential questions that might be in my upcoming exam in Digital Systems.
#include <stdio.h>
#include <string.h>
int main() {
char input1[600];
printf("What is the set of available registers?");
scanf("%s", &input1);
if(strcmp(input1, "registers, memory, hard disc") == 0){
printf("Good job! You got it right");
}
else {
printf("Wrong answer!");
}
So whenever I type "registers, memory, hard disc" when I'm asked it returns 1 instead of 0. I cannot see the problem. I am kind of new to C so sorry if it is a silly question.