b. Is the following case structure correct? If incorrect - what's wrong? (C++)
int name;
.
.
.
switch(name){
case 1;
.
.
.
break;
case 2;
.
.
.
break;
case 3;
.
.
.
break;
default;
.
.
.
}
We need at least 10 more requests to produce the answer.
0 / 10 have requested this problem solution
The more requests, the faster the answer.
b. Is the following case structure correct? If incorrect - what's wrong? (C++) int name; ....
20) What is the output of the following segment of C code: int avg(int n, int* a); int main () { int array[4]={1,0,6,9}; printf("%d", avg(4, array)+ 1); system("pause"); return 0; } int avg(int n, int* a) { int i, sum=0; for (i=0;i<n;i++) { sum+=a[i]; } return sum/n; } a) 16 b) 5 c) 4 d) 8 21) What is the output of the following segment of C code: int x = 2; int y = 3;...
int main() { int a, Band3 = 0, Band1, Band2, b, c = 1; float t; while (c) { Band3 = 0; printf(" Enter Resistance Value: "); scanf_s("%d", &a); printf("\n Enter Tolerance Value: "); scanf_s("%f", &t); b = t * 100; while (a % 10 == 0) { Band3++; a = a / 10; } Band2 = a % 10; a = a / 10; Band1 = a % 10; printf("\n Band1 = %d, Band2 = %d, Band3 = %d...
What's wrong with the following function? bool Greater (int param1, int param2) { if (param1 > param2) return true; }
9. Which of the following is true for the following program? #include <stdio.h> int maino int i = 1; switch (0) case 1: printf("%d", 0); case 2: printf("%d", 0); case 3: printf("%d", 0); default: printf("%d", 1); return 0; } (2 points) The program has no error, the output is 1111 The program has no error, the output is 1 The program produces a compile time error, because there are no break statements The program produces a compile time error, because...
41. Executing the "continue" statement from within a loop causes control to go A. to the next line of code B. out of the loop C. to the beginning of the loop D. to check the loop condition for repeating the loop E. none of the above 42. The 'default' statement inside a 'switch()' is optional. T__ F__ 43. The following 'switch' implementation is legal: int i = 2; ...
Convert the following code to assembly MIPS void checki() { int i = 0; while(i < 10) { switch(i) { case 1: i += 5; break; case 2: i --; break; case 3: i += 2; break; default: i++; } } } void main() { checki(); }
answer the all question
3. The foliowing IUPAC names are incorrect. State what is wrong in each case and provide the correct IUPAC name for the compound. dshic: Write the line-bond structure corresponding to given name t name it by IUPAC rules to obtain the correct name. (e) 2-Ethyl-2-methyylpropane (0 3-Methyl-4-ethylhexane (g) 2-Methyl-4-methylhexane (h) 5-Methyl -1-ethyleyclohexane (a) 2-Ethyl pentane (b) 3,3,4-Trimethylpentane (c) 4-Ethyl-3-methylhexane (d) 2,3.3-Trimethylbutane
Find the error in the following java code and explain how to correct it (val is a variable of type int): switch (val) { case 1: System.out.println ("The number is 1"); case 2: System.out.println ("The number is 2"); default: System.out.println ("The number is not 1 or 2"); break;
1)- Give the correct name (A-B) or draw the structure (C) for each of the following compounds, and use cis/trans, labeling when appropriate (Choose 2 Problems) CH[CH(CH:)),CF.CH[C(CH), JCH,C(CH),CHCI(CH(CH;)2] Name of A: Name of B: Trans- 1 cyclobutyl 3 isobutylyyclohexane Structure of C: Note: You must provide all answers on the original question sheet for and your answer should be written where specified. 1)- Give the correct name (A-B) or draw the structure (C) for each of the following compounds, a...
give the output of the codes in C++
int g(int x) { int tmp = x + 1; return x* tmp; int fint x, int y) { X += Y; return g(x); int main() { int x = 3; cout << g(x) << endl; cout << f(x, 1) << endl; cout << f(x, 2) << endl; int intVar = 24.2/2; cout<<intVar; Int main() int Enter = 1; switch (Enter) case 1: Enter = -4; case 2: Enter = -6; case...