0% found this document useful (0 votes)
926 views

cs201p Quiz 7

1. The seekg() and tellg() functions are used to determine the actual data length of a file. 2. Bit manipulation operators like | and & are used to set or check specific bits. 3. In C++, the default visibility for structures is private, and the -> operator is used to access members of a structure through a pointer.

Uploaded by

SAIM ALI RASHID
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
926 views

cs201p Quiz 7

1. The seekg() and tellg() functions are used to determine the actual data length of a file. 2. Bit manipulation operators like | and & are used to set or check specific bits. 3. In C++, the default visibility for structures is private, and the -> operator is used to access members of a structure through a pointer.

Uploaded by

SAIM ALI RASHID
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

CS201P QUIZ 7

0. In C++ combination 0f -------- and -------


functions are used to determine the actual data
length of a file.
Seekg(), tellg()
1. 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;
1
2. In bit manipulation of binary system , if we shift a bit
towards right then it means we are --------- that
binary value with “2”
Dividing
3. The bit manipulation operator ----------- is used to set
a specific bit.
|
4. In C++ default visibility of structure is---------
Private
5. In C++ when accessing files randomly, which function
is used to get current pointer position inside a file.
Tellg()
6. Which of the following statement is true regarding
structures?
Variables which are part of a structure are called data
members.
7. In C++ -------- function is used to write a character
into a file while --------- is used to get a character
from a file.
Putc(), getc()
8. What will be the output of the following code?
Struct student{
Int age;
Float cgpa;
Char name[20];
};
Int main()
{
Student s={21,3.56,”zaman”};
Cout<<sizeof(s);
}
28
9. The bit manipulation operation ------- is used to
check whether a specific bit is set or not.
&
10. Functions seekg() and seekp() require an
argument of type ------- to let them know bytes to
move forward or backward.
Long
11. In C++ which operator in used while accessing
through the pointer to structure.
->

You might also like