Programming MCQs Feed

📊 HTML
Q. Who is the father of HTML?
  • (A) Rasmus Lerdorf
  • (B) Tim Berners-Lee
  • (C) Brendan Eich
  • (D) Sergey Brin
💬 Discuss
✅ Correct Answer: (B) Tim Berners-Lee
📊 Linux
Q. Which Linux command list the contents of parent directory?
  • (A) ls ~
  • (B) ls */
  • (C) ls /
  • (D) ls .. /
💬 Discuss
✅ Correct Answer: (D) ls .. /
📊 Linux
Q. What command is used to count just the number of characters in a file?
  • (A) wc - r
  • (B) wc - w
  • (C) wc - c
  • (D) wc - 1
💬 Discuss
✅ Correct Answer: (C) wc - c
📊 JAVA
Q. Select the valid statement to declare and initialize an array.
  • (A) Int[] A = {}
  • (B) Int[] A = {1,2,3}
  • (C) Int[] A = (1,2,3)
  • (D) Int[][] A = {1,2,3}
💬 Discuss
✅ Correct Answer: (B) Int[] A = {1,2,3}
📊 C Programming
Q. What will be the output of the following C code?
Code:
        #include <stdio.h>
        int main()
        {
            int a[5] = {1, 2, 3, 4, 5};
            int i;
            for (i = 0; i < 5; i++)
                if ((char)a[i] == '5')
                    printf("%d\n", a[i]);
                else
                    printf("FAIL\n");
        }
  • (A) The compiler will flag an error
  • (B) The program will compile and print the output 5
  • (C) The program will compile and print the ASCII value of 5
  • (D) The program will compile and print FAIL for 5 times
💬 Discuss
✅ Correct Answer: (D) The program will compile and print FAIL for 5 times
📊 JAVA
Q. What is a Primitive Data Type in Java?
  • (A) Data type, which is implemented in an Object-oriented way.
  • (B) Data Type which is implemented in a machine-dependent way
  • (C) Data Type which is implemented in a non-object oriented way.
  • (D) None of the above
💬 Discuss
✅ Correct Answer: (C) Data Type which is implemented in a non-object oriented way.
📊 JAVA
Q. What is the output of Java program with SWITCH below?
Code:
int a=10;
switch(a)
{
case 10: System.out.println("TEN");
}
  • (A) No output
  • (B) TEN
  • (C) Compiler error as there is no BREAK.
  • (D) None
💬 Discuss
✅ Correct Answer: (B) TEN
📊 C Programming
Q. Choose a right statement.
Code:
int a = 3.5 + 4.5;
  • (A) a = 0
  • (B) a = 7
  • (C) a = 8
  • (D) a = 8.0
💬 Discuss
✅ Correct Answer: (C) a = 8
📊 CSS
Q. In a CSS file, there is a CSS rule for paragraphs tags – what does p can be called?
  • (A) Selector
  • (B) Attribute
  • (C) Property
  • (D) Tag
💬 Discuss
✅ Correct Answer: (A) Selector
📊 C#
Q. Which modifier is used to while redefining an abstract method by a derived class in C#?
  • (A) Overloads
  • (B) New
  • (C) Overrides
  • (D) Virtual
💬 Discuss
✅ Correct Answer: (C) Overrides