What is displayed? var n = 4; if (n > 5) { alert("Big"); } else { alert("Small"); }
MCQs — Programming Fundamentals
Practice questions for Computer Science.
Which statement is used to check more than two conditions one after another?
An if-else if statement gives Grade A for marks 80 or more, Grade B for marks 60 or more, and Grade C otherwise. How many possible outcomes are there?
What is a loop in programming?
Which pair of statements are loops in JavaScript?
How many times will this loop run? for (var i = 1; i <= 3; i++) { alert(i); }
In the loop for (var i = 1; i <= 5; i++), what does i++ do?
What is a loop inside another loop called?
Which situation is a suitable use of a nested loop?
What is an array?
In an array, what is the index of the first item?
What is displayed by alert(colours[2]); when var colours = ["red","green","blue"];?
What is a function in JavaScript?
After a function named show is defined, which statement runs it?
Which code correctly defines a function named show?
What is debugging?
What is an error in a program often called?
A JavaScript line is written as alert("Hi" without the closing bracket. What type of error is this?
A program runs without any error message but shows a wrong total. What kind of error is this?
A web page shows a broken image icon instead of the picture. What should the developer check first?
🎯 How to get the most out of these questions
- Attempt each question before revealing the answer.
- Read the explanation even when you answered correctly — it reinforces the concept.
- Note down any question you got wrong and revisit it the next day.
- Use the pagination below the list to work through every page — do not stop at page 1.
📌 MCQs — FAQs
Are the answers in this section verified?
Yes — every answer on this page has been verified. MCQs also include explanations where available.
Can I print these questions?
Yes — use your browser's print option (Ctrl+P / Cmd+P) to print or save the page as PDF.
How often are questions updated?
New questions are added regularly. If a paper pattern changes, existing questions are reviewed and updated.