Programming MCQs Feed

📊 C++
Q. What is the output of this program?
Code:
#include 
using namespace std;
    int main()
    {
        float num0 = 10.6;
        double num1 = 10.6;
        if (num0 == 10.6f)
            cout << "Arun";
        else
            cout << "Sharma";
        return 0;
    }
  • (A) Arun
  • (B) Sharma
  • (C) Compilation Error
  • (D) Runtime Error
💬 Discuss
✅ Correct Answer: (B) Sharma
📊 JavaScript
Q. JavaScript is also called as
  • (A) Server Side Scripting Language
  • (B) Browser Side Scripting Language
  • (C) Client Side Scripting Language
  • (D) Both B and C
💬 Discuss
✅ Correct Answer: (D) Both B and C
📊 C++
Q. In heap, which of these values will be pointed out first?
  • (A) First value
  • (B) Lowest value
  • (C) Third value
  • (D) Highest value
💬 Discuss
✅ Correct Answer: (D) Highest value
📊 Python
Q. Which command is used to add an element in the list
  • (A) list.sum(5)
  • (B) list1.add(5)
  • (C) list1.append(5)
  • (D) list.addelement(5)
💬 Discuss
✅ Correct Answer: (C) list1.append(5)
📊 Linux
Q. Context switching in Linux is
  • (A) Kernel switches from executing one process to another.
  • (B) Process switches from kernel mode to user mode.
  • (C) Process switches from user mode to kernel mode.
  • (D) None of the other option listed for this question
💬 Discuss
✅ Correct Answer: (C) Process switches from user mode to kernel mode.
📊 HTML
Q. Web page starts with following html tag?
  • (A) html
  • (B) form
  • (C) title
  • (D) body
💬 Discuss
✅ Correct Answer: (A) html
📊 C Programming
Q. What is the output of C program with structures?
Code:
int main()
{
    struct tree
    {
        int h;
        int w;
    };
    struct tree tree1={10};
    printf("%d ",tree1.w);
    printf("%d",tree1.h);
    return 0;
}
  • (A) 0 0
  • (B) 0 10
  • (C) 10 0
  • (D) 10 10
💬 Discuss
✅ Correct Answer: (B) 0 10
📊 PHP
Q. What will be the output of the following PHP code ?
Code:
<?php
if (print "Program ")
    print "Executed..." ;
else
    print "Not Executed...";
?>
  • (A) Program
  • (B) Executed...
  • (C) Not Executed...
  • (D) Program Executed...
💬 Discuss
✅ Correct Answer: (D) Program Executed...
📊 C Programming
Q. Which of the following is a User-defined data type?
  • (A) struct {char name[10], int age};
  • (B) typedef enum {Mon, Tue, Wed, Thu, Fri} Workdays;
  • (C) typedef int Boolean;
  • (D) all of the mentioned
💬 Discuss
✅ Correct Answer: (D) all of the mentioned
📊 C Programming
Q. What will be output for the following code?
Code:
#include<stdio.h> 
int main() 
{ 
    double x = 1.2; 
    int sum = (int)x + 1; 
  
    printf(""sum = %d"", sum); 
  
    return 0; 
} 
  • (A) sum = 0
  • (B) sum = 1
  • (C) sum = 2
  • (D) sum = 3
💬 Discuss
✅ Correct Answer: (C) sum = 2