0
hi everyone can you help me with this?
#include <stdio.h> #include <stdlib.h> #include<string.h> int main() { char *s1 ="asia"; char *s2[20]; char *ans1 ="a"; char *ans2[2]; printf("What is the largest continent:\n"); scanf("%s",s2); if(strcmp(s1,s2) ==0){ printf("Your right\n"); } else{ printf("Your answer is wrong\n");} printf("What is the largest continent\n a)Asia \n b)Africa \n c)Europe \n d)Australia\n"); scanf(" %c", ans2); if(strcmp(ans1, ans2) ==0){ printf("Yes you are right\n"); } else{ printf("Your answer is wrong\n"); } return 0; }
2 Answers
+ 5
Declarations you need actually:
char *s1 ="asia";
char s2[20];
char *ans1 ="a";
char ans2[2];
+ 1
Thanks bro