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; }

2nd Nov 2022, 1:42 PM
light angel
light angel - avatar
2 Respuestas
+ 5
Declarations you need actually: char *s1 ="asia"; char s2[20]; char *ans1 ="a"; char ans2[2];
2nd Nov 2022, 2:02 PM
Jayakrishna 🇮🇳
+ 1
Thanks bro
2nd Nov 2022, 2:14 PM
light angel
light angel - avatar