0

what is wrong in this code

#include <stdio.h> //(when 1 is entered) // without run, //the output of the code below is //A. 1 //B. 2 //C. compile time error //D. no compile time error int main() { char *ch; printf("enter a value btw 1 to 3 :"); scanf("%s",ch); switch(ch){ case "1": printf("1 ");break; case "2": printf("2 ");break; } // return 0; }

1st Jun 2022, 12:25 PM
ShriGanesh Saini
ShriGanesh Saini - avatar
1 Answer
+ 5
👉Please tag the relevant programming language 👉Please link your code: Go to Code section, click +, select the programming language, insert your code, save. Come back to this thread, click +, Insert Code, sort for My Code Bits, select your code. 👉Re-read how to get input. Pay attention to the syntax. 👉Re-read about data types. characters are marked with ' not with "
1st Jun 2022, 12:36 PM
Lisa
Lisa - avatar