Group: Guest
Posts: 5,799
Joined: May 26 2008
Contact:
Offline PMPoints:
109.60
quick question
What will the value of the variable Result be after the following code executes?
int base = 3;
int Result = 0;
Result = pow(base, 3);
1. 3
2. 6
3. 9
4. 27
If A1 is true and A2 is true, which of the following expressions is false?
1. A1 || A2
2. !(A1 || A2)
3. A1 && A2
4. A1 || (!(A2))
Which of the following statements about switch statements in C++ is false?
1. Use of the default keyword is optional.
2. A switch statement cannot end with a break keyword.
3. The allowable data types for the controlling expression are integer or character.
4. A set of curly braces must be placed around the case labels used in the switch statement.
Group: Members
Posts: 74,769
Joined: Aug 5 2007
Contact:
Offline PMPoints:
7,730.25
1. pow(base,3)
is 3 to the base power, base is declared as 3, 3^3 = 27
brb mimiron trash
Group: Members
Posts: 74,769
Joined: Aug 5 2007
Contact:
Offline PMPoints:
7,730.25
i dont remember what logical operator || is
Group: Members
Posts: 74,769
Joined: Aug 5 2007
Contact:
Offline PMPoints:
7,730.25
1. A1 || A2
2. !(A1 || A2)
3. A1 && A2
4. A1 || (!(A2))
donno order of the operators or distribution or something for number 2, but it seems one of them must be true and the other must be false
editing poop
This post has been edited by randomtask on Wed - Jun 24 2009 - 20:54:18
Group: Members
Posts: 74,769
Joined: Aug 5 2007
Contact:
Offline PMPoints:
7,730.25
actually OR can be true if both are true, was thinking XOR
Group: Members
Posts: 74,769
Joined: Aug 5 2007
Contact:
Offline PMPoints:
7,730.25
1. true or true = true
2. not (true or true) = false
3. true (exclusive and?) true = donno
4. true or not true = true
so proalbey number 2
Group: Members
Posts: 74,769
Joined: Aug 5 2007
Contact:
Offline PMPoints:
7,730.25
dont remember shit about switch statements, try google/wikipedia switch statements for that one