Programming MCQs Feed

📊 C Programming
Q. Choose a right statement.
Code:
int a = 10 + 4.867;
  • (A) a = 10
  • (B) a = 14.867
  • (C) a = 14
  • (D) compiler error.
💬 Discuss
✅ Correct Answer: (C) a = 14
📊 CSS
Q. What is a CSS selector?
  • (A) A CSS selector is the CSS class name
  • (B) A CSS selector is the set of properties that are going to be applied on HTML elements
  • (C) A CSS selector is name of CSS file.
  • (D) A CSS selector is the first part of a CSS Rule. It may an HTML element or pattern of elements.
💬 Discuss
✅ Correct Answer: (D) A CSS selector is the first part of a CSS Rule. It may an HTML element or pattern of elements.
📊 C#
Q. Which type of class does not have its own objects but acts as a base class for its subclass in C#?
  • (A) Abstract Class
  • (B) Static Class
  • (C) Sealed Class
  • (D) Protected Class
💬 Discuss
✅ Correct Answer: (A) Abstract Class
📊 PHP
Q. A PHP script starts with ____ and ends with ___.
  • (A) <?php and ?>
  • (B) <php> and </php>
  • (C) <?php and /?php>
  • (D) </php and />
💬 Discuss
✅ Correct Answer: (A) <?php and ?>
📊 C++
Q. What happens if the line below is executed in C and C++?
Code:
int *ptr = malloc(20);
  • (A) Error in C and C++
  • (B) Warning in C and C++
  • (C) Error in C++ and success in C
  • (D) Error in C and success in C++
💬 Discuss
✅ Correct Answer: (C) Error in C++ and success in C
📊 C++
Q. Which of the following statements is true about the following instruction?
  • (A) Creates a variable of type integer with the identifier b and 100 as value.
  • (B) Declares a constant b whose value will be 100.
  • (C) Declare an integer b with 100 as initial value.
  • (D) Declares a variable b with 100 as initial value.
💬 Discuss
✅ Correct Answer: (B) Declares a constant b whose value will be 100.
📊 Linux
Q. Which command displays the contents of a file?
  • (A) tee
  • (B) Is
  • (C) T pipe
  • (D) cat
💬 Discuss
✅ Correct Answer: (D) cat
📊 SQL Server
Q. Code for creating an HTML report that lists the name of each service along with its status is __________
  • (A) Get-Ser | ConvertTo-HTML -Property Name, Status > C:\services.htm
  • (B) Get-Service | Property Name, Status > C:\services.htm
  • (C) Get-Service | ConvertTo-HTML -Property Name, Status > C:\services.htm
  • (D) All of the mentioned
💬 Discuss
✅ Correct Answer: (C) Get-Service | ConvertTo-HTML -Property Name, Status > C:\services.htm
📊 MySQL
Q. The term ___________ is used to refer a column.
  • (A) Row
  • (B) Record
  • (C) Tuple
  • (D) Attribute
💬 Discuss
✅ Correct Answer: (D) Attribute
📊 C++
Q. What does the following statement mean?
Code:
int (*fp)(char*)
  • (A) function taking a char* argument and returning a pointer to int
  • (B) pointer to a pointer
  • (C) pointer to an array of chars
  • (D) pointer to function taking a char* argument and returns an int
💬 Discuss
✅ Correct Answer: (D) pointer to function taking a char* argument and returns an int