- Type
- Quiz
- Course
- CS201P Introduction to Programming (Practical)
- Size
- PDF 857 KB
- Updated
- 23 Oct 2026
You get 3 free files a day on the website. Add the Chrome extensionSign in with the extension for 30 a day.
Preview text
Text from pages 1, 2 of 2. Download the file for all 2 pages.
Q1. What will be the output of the following code? int i = 0; while(i!=15){ cout << i << " "; i = i + 5; }
Correct answer: 0 5 10
Q2. Which of the following C++ statements is used to show output on the screen?
Correct answer: cout
Q3. In C++, which of the following option has the correct meaning of the expression “a <= b” ?
Correct answer: a is less than or equal to b
Q4. What will be the output of following program? #include <iostream> using namespace std; int main() { int x = 5; while (x > 0) { x--; } cout << "Final value of x: " << x << endl; return 0; }
Correct answer: Final value of x: 0
Q5. In C/C++, the algebraic expression (b2-4ac) / 2a can be written as:
Correct answer: (b*b – 4*a*c) / (2*a)
Q6. What will be the output of the following code? int i = 1; while(i<10){ if (i % 2 == 0) cout << i << “ ”; i++; }
Correct answer: 2 4 6 8
Q7. Which of the following is an example of logical operator?
Correct answer: &&,||
Q8. Which of the following option is used when working with complicated expressions in C++ ?
Correct answer: ()
Q9. Which of the following is an example of repetition structure?
Correct answer: while
Q10. Which of the following C++ statements is used take input from the user?
Correct answer: cin
Related CS201P files
All CS201P files →Get more out of VUBuddy, for free
- Unlimited downloads
- The explanation behind every MCQ answer
- Study offline on slow data
- 30 downloads a day instead of 3
- Sign in and buy Pro Semester here
One Pro Semester membership works in both the extension and the app.