What Is The Only Function All C
What Is The Only Function All C
A. start()
B. system()
C. main()
D. program()
3. What punctuation is used to signal the beginning and end of code blocks?
A. { }
B. -> and <-
C. BEGIN and END
D. ( and )
2. What is the return type of the function with prototype: "int func(char x,
float v, double t);"
A. char
B. int
C. float
D. double
2. What is required to avoid falling through from one case to the next?
A. end;
B. break;
C. Stop;
D. A semicolon.
3. What keyword covers unhandled possibilities?
A. all
B. contingency
C. default
D. other
switch(x)
case 1: cout<<"One";
case 0: cout<<"Zero";
}
A. One
B. Zero
C. Hello World
D. ZeroHello World
Part A executes because x==5 (true) and y==2 (true), thus the AND
operation evaluates as true.
Part B executes because (x & y) results in 0, or false.
Part A executes because (x & y) results in a nonzero value, or true.
Part B executes because the statement (x & y) is invalid, thus false.
3
7
-3
13
Which choice does not produce the same output as this code snippet?
Assume the variable i will not be used anywhere else in the code.
for (i=1;i<10;i++){
cout<<i<<endl;
}
A.
i=1;
while(i<10){
cout<<++i<<endl;
}
B.
for (int i:{1,2,3,4,5,6,7,8,9}) {
cout<<i<<endl;
}
C.
i = 1;
do {
cout<<i++<<endl;
} while(i<10);
D.
i = 1;
loop:
cout<<i++<<endl;
if(i<10) goto loop;