CS201P Attendance Quiz 07 Fall 2024
Here are the Multiple Choice Questions (MCQs) and their correct answers based on the previous quiz:
1. The bit manipulation operator ______________ is used to set a specific bit.
- Correct Answer:
|
2. In C++, which operator is used while accessing through the pointer to structure?
- Correct Answer:
->
3. What will be the output of the following code?
int num = 2;
int count=0;
while(num!= 0)
{
if (num & 01)
count ++;
num >>=1;
}
cout << count;
return 0;
- Correct Answer:
1
4. In C++, __________ function is used to write a character into a file while _______ is used to get a character from a file.
- Correct Answer:
putc(), getc()
5. In C++, combination of ________ and _________ functions are used to determine the actual data length of a file.
- Correct Answer:
seekg(), tellg()
Let me know if you need further explanations!