Home / Chandani / Programming MCQs Solution

Programming Portal Solution

You will find all Programming Portal MCQs whose solution is updated by Chandani

Q. Which object method is used to get object keys?

Q. What will this output?

Q. What does the spread operator (...) do?

Q. What is the output?

Q. Which keyword is used to handle errors?

Q. What is the result?

Q. Which keyword prevents object modification?

Q. What is the default scope of variables declared with var?

Q. What does isNaN('hello') return?

Q. Which function executes a function after a specified time?

Q. What will be the output?

Q. What is returned by JSON.parse('true')?

Q. What is the result?

Q. Which of these is not a primitive data type?

Q. What will the following return?

Q. Which method is used to add elements at the beginning of an array?

Q. What is the output?

Q. What will be printed?

Q. Which statement is used to exit a loop early?

Q. What will be logged?

Q. What is the default return value of a function with no return statement?

Q. What will be the result?

Q. Which method checks if an array contains a certain value?

Q. What will the following code return?

Q. How can you prevent a variable from being reassigned?

Q. What will this output?

Q. Which keyword is used for inheritance in ES6 classes?

Q. Which of these is a valid JavaScript variable name?

Q. Which array method returns a new array with only truthy values?

Q. Which method is used to convert an object to JSON string?

Q. What does the following return?

Q. What is the output?

Q. Which is not a valid JavaScript data type?

Q. What will this expression return?

Q. What is the result of the following?

Q. What will be logged?

Q. Which statement is true for arrow functions?

Q. How to convert a string to an integer in JavaScript?

Q. Which statement is true about let, var, and const?

Q. What will this return?

Q. Which of the following is true about 'const'?

Q. Which method returns the first index of an element?

Q. What type is returned by Array.isArray([])?

Q. What is the output?

Q. What does the 'await' keyword do?

Q. How can you clone an object in JavaScript?

Q. Which value is returned when a function doesn't explicitly return anything?

Q. What is hoisting in JavaScript?

Q. Which of the following is a correct way to declare an arrow function?

Q. What will be the output?

Q. What is the default value of 'this' in a JavaScript class method?

Q. What does '===' operator check?

Q. What will be logged?

Q. Which of the following is used to create a new Promise?

Q. What will the following return?

Q. What does 'this' refer to in a regular function?

Q. What will be the value of x?

Q. Which keyword creates a constant in JavaScript?

Q. What is the result of this?

Q. What does this code do?

Q. Which method can be used to iterate over an array?

Q. What will this log?

Q. What does the rest operator do?

Q. How do you write an arrow function that returns 10?

Q. What is the output of this expression?

Q. Which one is not a primitive data type in JavaScript?

Q. What does this function return?

Q. What is the purpose of the isNaN() function?

Q. What will the code output?

Q. Which of these is not a looping structure in JavaScript?

Q. What does the following return?

Q. What will this return?

Q. What is the output?

Q. How can you prevent a default event action in JavaScript?

Q. What will be logged?

Q. Which of the following creates a new array with results of calling a function on every element?

Q. Which one will return 'true'?

Q. Which function is used to execute a function after a delay?

Q. What is a Promise in JavaScript?

Q. What does this expression return?

Q. What is the value of x?

Q. Which of the following is a falsy value?

Q. What will this return?

Q. Which operator is used to merge two arrays?

Q. What will be the result?

Q. Which object method returns an array of a given object's property names?

Q. What will be logged?

Q. How do you write a conditional statement for executing code if 'x' is greater than 5?

Q. What is the result of this code?

Q. Which operator is used for optional chaining?

Q. How do you convert a number to a string in JavaScript?

Q. What is the output of this code?

Q. What will this function return?

Q. What will this code print?

Q. Which method adds an element at the end of an array?

Q. What will be the output of this code?

Q. Which of the following is used to handle exceptions in JavaScript?

Q. What will the output be?

Q. Which function is used to parse a string to an integer?

Q. What will the following code print?

Q. Which of the following is not a JavaScript data type?

Q. What is the result of typeof NaN in JavaScript?

Q. Which built-in method reverses the elements of an array?

Q. What does '===' operator do in JavaScript?

Q. How do you define an arrow function in JavaScript?

Q. What will be the output of the following code?

Q. What is the output of: console.log('5' + 3);

Q. Which of the following methods converts JSON data to a JavaScript object?

Q. What will be the output of: console.log(typeof null);

Q. Which of the following is a correct way to declare a variable in JavaScript?

Q. Which of the following is not javascript data types?

Q. Will the following JavaScript code work?

Q. What will be the output of the following JavaScript code snippet?

Q. What will be the output of the following JavaScript code?

Q. Arrays in JavaScript are defined by which of the following statements?

Q. What will be the output of the following JavaScript code?

Q. What will be the output of the following JavaScript code snippet?

Q. Among the given statements, which statement defines closures in JavaScript?

Q. Which of the following is correct about JavaScript?

Q. What is JavaScript?

Q. Which function is used to compare two strings in C?

Q. What will be the output of the following C code? (If the input is "Hello world")

Q. What will be the output of the following C code?

Q. What will be the output of the following C code?

Q. Which function is used to concatenate two strings in C?

Q. Which function is used to read a line of text including spaces from the user in C?

Q. Which format specifier is used to read and print the string using printf() and scanf() in C?

Q. Consider the below statement, can we assign a string to variable like this:

Q. A string is terminated by ___

Q. Can a loop be nested in C programming?

Q. When the condition of the do-while loop is false, how many times will it execute the code?

Q. Which of the following parts of the for loop can be eliminated in C?

Q. Which loop executes the block a specific number of times?

Q. Which of the following is valid syntax for creating a while loop?

Q. Which of these statements is correct in case of while loop in C?

Q. What will happen if the loop condition will never become false?

Q. Which statements are used to change the execution sequence?

Q. Which of these is an exit-controlled loop?

Q. What will be the output of the following C code?

Q. Without a break statement in switch what will happen?

Q. Which of the following syntax is correct for nested if-else statements?

Q. Is it possible to nest if-else statements in C programming?

Q. How many expressions can be checked using if...elseif...else statement?