Mathematic Operations And Loops(Engineering > Computer Science And Engineering > Ruby Programming ) Questions and Answers
Explanation:-
Answer: Option B. -> 2 4 16 The counter will increment by the power of two.
Output:
2
4
16
Explanation:-
Answer: Option C. -> 1 4 9 16 25 Loop till the condition is met and break when the condition is not satisfied.
Output:
1
4
9
16
25
Explanation:-
Answer: Option B. -> Not same a and b are not similar hence the else condition will get executed.
Output:
Not same
Explanation:-
Answer: Option A. -> 12345678910 Loop till the condition is met and break when the condition is not satisfied.
Output:
12345678910
Explanation:-
Answer: Option B. -> False 77
Explanation:-
Answer: Option A. -> True Boolean operator || evaluates to true only when both the values are true or one is true and other is false.
Explanation:-
Answer: Option A. -> hungry Until the condition is not met execute the loop.
Output:
hungry
Explanation:-
Answer: Option B. -> 50 56 The do statement here indicates that till the while condition is true execute the instructions and will print a*b only till a
Output:
50
56
Explanation:-
Answer: Option B. -> 321 The do statement here indicates that till the while condition is true execute the instructions.
Output:
321
Explanation:-
Answer: Option A. -> 10 12 14 16 Execute the loop till the condition is met.
Output:
10
12
14
16