What punctuation is used to signal the beginning and end of a code \"block\" in
ID: 3694134 • Letter: W
Question
What punctuation is used to signal the beginning and end of a code "block" in C/C++? A,{ and } B. [ and ] C. BEGIN and END D. (and) 7) What is the exact output of the following code snippet: int x=0; switch(x) { case 1: printf("One"); case 0: printf("Zero"); case 2: printf("Hello World"); } A. One B.Zero C. Hello World D. ZeroHello World 8) What command is missing from the switch statement above that is causing it to act to so strangely? 9)True or false: C/C++ considers the variables int N; and int n; to be different virtables.10) Write a clearly written sentence or two that describes How Local Variables different than Global Variables in a program.Explanation / Answer
A D (Since break is not given between cases hence normal fall through will happen) break; True (C++ is case-sensitive) The scope of a global variable is entire program i.e. any function can use it. Whereas the scope of a local variable is just the block in which it has been defined.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.