Ruby Programming Questions and Answers – Introduction to Hashes

This set of Ruby Programming Interview Questions and Answers for Experienced people focuses on “Introduction to Hashes”. 1. It is possible to make array of booleans. a) True b) False 2. What is the output of the given code? string_array = ["a","e","i","o","u"] print string_array a) [“a”,”e”,”i”,”o”,”u”]. b) Error c) Vowels d) None of the mentioned … Read more

advertisement

Ruby Programming Questions and Answers – Arrays of Arrays

This set of Ruby Programming Multiple Choice Questions & Answers (MCQs) focuses on “Arrays of Arrays”. 1. Array of arrays are called multidimensional arrays. a) True b) False 2. What is the output of the given code? multi_d_array = [[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]] print multi_d_array a) [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], … Read more

advertisement

Ruby Programming Questions and Answers – Arrays of Non-Numbers

This set of Basic Ruby Programming Questions and Answers focuses on “Arrays of Non-Numbers”. 1. It is possible to make array of booleans. a) True b) False 2. What is the output of the given code? string_array = ["a","e","i","o","u"] print string_array a) [“a”,”e”,”i”,”o”,”u”]. b) Error c) Vowels d) None of the mentioned 3. What is … Read more

advertisement

Ruby Programming Questions and Answers – Arrays

This set of Ruby Programming Multiple Choice Questions & Answers (MCQs) focuses on “Arrays”. 1. Arrays can be used to store multiple values in one single variable. a) True b) False 2. What will be output of the given code? my_array = [1, 2, 3, 4] print my_array a) [1, 2, 3, 4]. b) 1234 … Read more

advertisement

Ruby Programming Questions and Answers – For Loop

This set of Ruby Programming Multiple Choice Questions & Answers (MCQs) focuses on “For Loop”. 1. What is the output of the given code? for num in 1…5 puts num end a) 1 2 3 4 5 b) 1 2 3 4 c) 2 3 4 5 d) None of the mentioned 2. What does … Read more

advertisement

Ruby Programming Questions and Answers – Until Loop

This set of Ruby Programming Questions and Answers for Experienced people focuses on “Until Loop”. 1. The complement of while loop is until loop. a) True b) False 2. What is the output of the given code? counter = 1 until counter > 10 puts counter counter+=1 end a) 1 2 3 4 5 6 … Read more

advertisement

Ruby Programming Questions and Answers – While Loop

This set of Ruby Programming Multiple Choice Questions & Answers (MCQs) focuses on “While Loop”. 1. While loop checks the condition and the loop keeps on running till the condition is true, it stops when the condition becomes false. a) True b) False 2. What is the output of the given code? counter = 1 … Read more

advertisement

Ruby Programming Questions and Answers – Assignment Operators

This set of Ruby Programming Multiple Choice Questions & Answers (MCQs) focuses on “Assignment Operators”. 1. Which of the following is a valid assignment operator? a) += b) -= c) *= d) All of the mentioned 2. What does the **= assignment operator do? a) Multiplies the value twice b) It is used as exponent … Read more

advertisement

Ruby Programming Questions and Answers – Operators

This set of Ruby Programming Multiple Choice Questions & Answers (MCQs) focuses on “Operators”. 1. Boolean opeartors are also known as logical operators. a) True b) False 2. Which of the following is a valid boolean operator? a) and(&&) b) or(||) c) not(!) d) All of the mentioned 3. The boolean operator && only result … Read more

advertisement

Ruby Programming Questions and Answers – Comparisons

This set of Ruby Programming Multiple Choice Questions & Answers (MCQs) focuses on “Comparisons”. 1. The == ‘is equal to’ is known as relational operator. a) True b) False 2. The ‘=’ is used for assigning value to variable? a) True b) False 3. What will the following code evaluate to? a=9!=10 a) True b) … Read more

advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.