+ 1
help..me..
Char a [4] = "pen"; Char input [8]; Puts ("Guess my name. \ N"); Printf ("1.I am a lot of people around. \ N"); Printf ("2.I can draw letters and pictures. \ N"); Printf ("answer:"); Scanf ("% s", input); If (input == a); Printf ("corect answer"); If (input! = A); Printf ("It is not corect answer"); If (input! = A); Printf ("It is not corect answer"); If you enter the correct answer here, this sentence will not print. How do you fix it? You can not do an else statement.
2 Answers
+ 26
use string function for comparing two strings
i.e.,
if(strcmp(a,input)==0)
printf("Correct");
if(strcmp(a,input)!=0)
printf("It is not correct answer");
for using this function use string.h library
+ 1
thank you



