Home / MCQ Bank / Computer
Computer Control Structures

What will be the output of the following C code? #include <stdio.h> int main() { int x = 0; if (x == 1) if (x >= 0) printf("true\n"); else printf("false\n"); }

Select the best option to verify your answer:
Show Correct Answer
Correct Answer: Option D • No print statement

Related Computer Questions

Which of the following is not a appropriate value for voice-rate? What is the output of the following code? #include<stdio.h> int get_min(int a, int b) { if(a<b) return a; return b; } int minimum_time_required(int reach[][4],int spent[][5], int *entry, int *exit, int n) { int t1[n], t2[n], i; t1[0] = entry[0] + spent[0][0]; t2[0] = entry[1] + spent[1][0]; for(i = 1; i < n; i++) { t1[i] = get_min(t1[i-1]+spent[0][i], t2[i-1]+reach[1][i-1]+spent[0][i]); t2[i] = get_min(t2[i-1]+spent[1][i], t1[i-1]+reach[0][i-1]+spent[1][i]); } return get_min(t1[n-1]+exit[0], t2[n-1]+exit[1]); } int main() { int time_to_reach[][4] = {{16, 10, 5, 12}, {12, 4, 17, 8}}; int time_spent[][5] = {{13, 5, 20, 19, 9}, {15, 10, 12, 16, 13}}; int entry_time[2] = {12, 9}; int exit_time[2] = {10, 13}; int num_of_stations = 5; int ans = minimum_time_required(time_to_reach, time_spent, entry_time, exit_time, num_of_stations); printf("%d",ans); return 0; } What will be the output of the following C++ code? #include <iostream> using namespace std; class Base { public: Base ( ) { cout << "1" << endl; } ~Base ( ) { cout << "2" << endl; } }; class Derived : public Base { public: Derived ( ) { cout << "3" << endl; } ~Derived ( ) { cout << "4" << endl; } }; int main( ) { Derived x; } The switch statement is also called as? What is the significance of the Hadoop MapReduce "Custom InputFormat" in advanced MapReduce?