Programming MCQs Feed

📊 C++
Q. What are the escape sequences?
  • (A) Set of characters that convey special meaning in a program
  • (B) Set of characters that are used in the name of the main function of the program
  • (C) Set of characters that whose use are avoided in C++ programs
  • (D) Set of characters that are avoided in cout statements
💬 Discuss
✅ Correct Answer: (A) Set of characters that convey special meaning in a program
📊 Linux
Q. User passwords are stored in _____________
  • (A) /root/password
  • (B) /etc/password
  • (C) /etc/passwd
  • (D) /root/passwd
💬 Discuss
✅ Correct Answer: (C) /etc/passwd
📊 C++
Q. What is the correct syntax of accessing a static member of a class in C++?
Code:
Example class:
class A
{
	public:
		static int value;
}
  • (A) A::value
  • (B) A->value
  • (C) A^value
  • (D) A.value
💬 Discuss
✅ Correct Answer: (A) A::value
📊 Python
Q. Output of the following python program will be?
Code:
x = [i**+1 for i in range(3)]; print(x);
  • (A) [1,2,5]
  • (B) [0,1,2]
  • (C) Error ';"
  • (D) None of the above
💬 Discuss
✅ Correct Answer: (B) [0,1,2]
📊 Linux
Q. Which command and options are used to delete a user’s account and home directory?
  • (A) usermod -e
  • (B) passwd -e
  • (C) usermod -f
  • (D) userdel -r
💬 Discuss
✅ Correct Answer: (D) userdel -r
📊 C++
Q. A class is a collection of ________ and _________
  • (A) data-members, member functions and main()
  • (B) data-members, member functions, main() and include statements
  • (C) data-members & member functions
  • (D) None of the above
💬 Discuss
✅ Correct Answer: (C) data-members & member functions
📊 C Programming
Q. Which of the following storage classes have global visibility in C?
  • (A) Auto
  • (B) Static
  • (C) Extern
  • (D) Register
💬 Discuss
✅ Correct Answer: (C) Extern
📊 MySQL
Q. The string function that returns the index of the first occurrence of substring is _____________.
  • (A) INSTRING()
  • (B) INSERT()
  • (C) INSTR()
  • (D) INFSTR()
💬 Discuss
✅ Correct Answer: (C) INSTR()
📊 C Programming
Q. What is the scope of static class specifier?
  • (A) Global Multiple files
  • (B) Within block
  • (C) Within Program
  • (D) None of the above
💬 Discuss
✅ Correct Answer: (B) Within block