#include<stdio.h>
#include<conio.h>
#include<string.h>
int x;
char name[20];
main()
{
printf("Exercise no. 10 ESN 211-9A MWF 7:30-9;30\n\n");
printf("Enter your age:\n");
scanf("%d",&x);
if (x<18)
printf("UNDERAGE!\n\n");
else if (x==18)
printf("STUDENT LICENSE POSSIBLE\n\n");
else
printf("PROFESSIONAL LICENSE AVAILABLE\n\n");
printf("Enter the result of your drug test: \n");
scanf("%s",&name);
if ( name == "positive" )
printf("HOLD LICENSE");
else
printf("RELEASE LICENSE");
getch();
}
The program is working but the part about the drug test is wrong. When i input positive it outputs RELEASE LICENSE instead of HOLD LICENSE. What seems to be the problem of my program? am i missing something? or is it just simply wrong? :D please help me. thank you! :)