Current location - Recipe Complete Network - Complete cookbook of home-style dishes - How to write a menu in C language?
How to write a menu in C language?
The process is as follows:

# include & ltstdio.h & gt

# include & ltstring.h & gt

intMENU_Print(ints32QuerNum)

{

Switch (s32QuerNum)

{

Case 1:

Printf(\ "The theme you selected is as follows: \");

Printf(\" 1, the following can correctly represent the identifier: () \ ");

printf(\"A、Data、Double \ ");

printf(\"B、case、Big \ ");

printf(\"C、20 1 1A,hi _ ok \ ");

Printf(\"D, _20 1 1, date of year \ ");

Break;

Case 2:

Printf(\ "The theme you selected is as follows: \");

Printf(\"2, the following operators have the lowest priority: () \ ");

printf(\"A,:\");

printf(\"B、++ \ ");

printf(\"C 、& amp& amp\");

printf(\"D 、+ = \ ");

Break;

Case 3:

Printf(\ "The theme you selected is as follows: \");

Printf(\"2。 The following options cannot be assigned correctly: () \ ");

printf(\"A、chars[20]; s = \ " ABCDE \ " \ ");

printf(\"B、chars[]= \ " ABCDE \ " \ ");

printf(\"C、chars[20]= { \ " ABCDE \ " } \ ");

printf(\"D、chars[20]={'A ',' B ',' C ' } \ ");

Break;

Default value:

Break;

}

return0

}

intmain()

{

int s32 choose num = 0;

while( 1)

{

Printf(\ "The question number range is 1-3, please enter the question number: \");

scanf(\"%d