Given the following seqment of code containing a group of
nested if instructions: y = 9; if ((x==3) || (x == 5)) y++;
else if (x == 2) y *= 2; else if (x == 4 ) y-= 7; else y =
8; Enter a segment of code (without any IF statements) that
does exectly the same thing using the switch structure.
Answer / isha
y=9;
switch(x)
{
case 2:y*=2;
break;
case 3:
case 5: y++;
break;
case 4:y-=7;
break;
default:y=8;
}
| Is This Answer Correct ? | 2 Yes | 0 No |
Explain the static member function.
How can you quickly find the number of elements stored in a dynamic array?
Do class declarations end with a semicolon? Do class method definitions?
What are the basic data types used in c++?
What are 2 ways of exporting a function from a dll?
sir there is some problem with nokia5130c-2,when we are trying to upload movies from net then there is a error occurred"FORMAT NOT SUPPORTED" bt its all ready in 3gp format.please tell me what i do now?
What does #define mean in c++?
Why do we use constructor?
What is endl?
What is Namespace?
Do you know about C++ 11 standard?
0 Answers Agilent, ZS Associates,
Copy Linked List using recursive function?