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