Home / MCQ Bank / Computer
Computer Control Structures In Ruby Difficulty: Medium

What is the output of the given code? x=1 if x > 2 puts "x is greater than 2" elsif x <= 2 and x!=0 puts "x is 1" else puts "I can't guess the number" end

Select the correct option to test your answer:

More Computer Questions

The pre-order and in-order are traversals of a binary tree are T M L N P O Q and L M N T O P Q. Which of following is post-order traversal of the tree? What will be the output of the following Java program? class access { public int x; static int y; void cal(int a, int b) { x += a ; y += b; } } class static_specifier { public static void main(String args[]) { access obj1 = new access(); access obj2 = new access(); obj1.x = 0; obj1.y = 0; obj1.cal(1, 2); obj2.x = 0; obj2.cal(2, 3); System.out.println(obj1.x + " " + obj2.y); } } What is the purpose of passing arguments by reference in C++ functions? Which EDA technique is used to display the distribution of a single variable, especially in cases of categorical data? Which is a swapping device is used to hold the images of pages in main memory.