Programming MCQs Feed

📊 C++
Q. Which of the following is called extraction/get from operator?
  • (A) >>
  • (B) <<
  • (C) >
  • (D) <
💬 Discuss
✅ Correct Answer: (A) >>
📊 Linux
Q. Which command is used to remove files?
  • (A) rm
  • (B) dm
  • (C) erase
  • (D) delete
💬 Discuss
✅ Correct Answer: (A) rm
📊 C++
Q. What will be the output of the following C++ code?
Code:
#include<iostream>
using namespace std;
int main ()
{
   int cin;
   cin >> cin;
   cout << "cin: " << cin;
   return 0;
}
  • (A) Nothing is printed
  • (B) Segmentation fault
  • (C) cin: garbage value
  • (D) Error
💬 Discuss
✅ Correct Answer: (C) cin: garbage value
📊 Python
Q. In which of the following we can use "in" operator to check the elements
  • (A) dictionary
  • (B) list
  • (C) tuple
  • (D) All of the above
💬 Discuss
✅ Correct Answer: (B) list
📊 Linux
Q. Which command will immediately shut down a computer running Linux?
  • (A) telinit 0
  • (B) shutdown now
  • (C) telinit 6
  • (D) shutdown
💬 Discuss
✅ Correct Answer: (A) telinit 0
📊 C++
Q. First edition of the C++ programming language was released in:
  • (A) 1950
  • (B) 1980
  • (C) 1985
  • (D) 1990
💬 Discuss
✅ Correct Answer: (C) 1985
📊 C Programming
Q. The ________ operator is true only when both the operands are true.
  • (A) or
  • (B) and
  • (C) boolean
  • (D) bitwiseor
💬 Discuss
✅ Correct Answer: (B) and
📊 PHP
Q. What will be the output of the following PHP code ?
Code:
<?php
$p = 20;
if ($p = $p&0)
    print $p ;
else
    print "Executed...";
?>
  • (A) Error
  • (B) Nothing
  • (C) Executed...
  • (D) 20
💬 Discuss
✅ Correct Answer: (C) Executed...
📊 C Programming
Q. The value of an automatic variable that is declared but not initialized will be
  • (A) 0
  • (B) Null
  • (C) Garbage
  • (D) None of these
💬 Discuss
✅ Correct Answer: (C) Garbage
📊 C Programming
Q. What is the output of this program?
Code:
#include <stdio.h>
#define clrscr() 17
int main()
{
  clrscr();
  printf("%d",clrscr());
  return 0;
}
  • (A) 17
  • (B) Compilation error
  • (C) Runtime error
  • (D) none of the above
💬 Discuss
✅ Correct Answer: (A) 17