S
sophia.agnes
Dear all,
I was going through a C book written by an indian author
the following are the questions given in that book
1) consider the following statement:
s1 : an operator may require an lvalue operand, yet yield an r
value
s2: an operator may accept an rvalue operand , yet gives an lvalue
which of the following is true about s1 and s2
(a) both s1 and s2 are true
(b) only s1 correct
(c) only s2 is correct
(d) both are false
answer is given as (a)
& is one such operator
int n;
*n is lvalue
&n is rvalue
operator operand result
& n is l value &n rvalue
* (p + 1) is r value *(p + 1) lvalue
2) which of the following is false
a) a string has type array of characters
b) a string has storage class static
c) adjacent string literals are concatenated into a single string
d) Concatenation of ordinary and wide string literal is a single
string
answer is given as d option
3)consider the following
process1(int counter)
{
if(counter == 1)
{
char buf[80];
--------------
}
}
process2(int counter)
{
char buff[80];
if(counter == 1)
{
--------
}
}
which one of the following is true
(a) both process require same stack space in all cases
(b) process 1 require more stack space
(c) process 2 require more stack space
(d) stack space for process is not allocated if counter == 1
answer is given as a option
4) consider the following statements
s1: evaluating the address of an object value after indirection is
simply object
s2:evaluating an object value from indirecting after taking its
address is not the object
which of the following is true
(a) only s1
(b) both are correct
(c) only s2 is correct
(d) both are wrong
answer is given as b option
5)which operation require more memory access
(a) branch
(b) conditional code test
(c) shift register right /* what is this ?*/
(d) all are same
answer is given as d option
well what do you folks think of all this stuff ?
I was going through a C book written by an indian author
the following are the questions given in that book
1) consider the following statement:
s1 : an operator may require an lvalue operand, yet yield an r
value
s2: an operator may accept an rvalue operand , yet gives an lvalue
which of the following is true about s1 and s2
(a) both s1 and s2 are true
(b) only s1 correct
(c) only s2 is correct
(d) both are false
answer is given as (a)
& is one such operator
int n;
*n is lvalue
&n is rvalue
operator operand result
& n is l value &n rvalue
* (p + 1) is r value *(p + 1) lvalue
2) which of the following is false
a) a string has type array of characters
b) a string has storage class static
c) adjacent string literals are concatenated into a single string
d) Concatenation of ordinary and wide string literal is a single
string
answer is given as d option
3)consider the following
process1(int counter)
{
if(counter == 1)
{
char buf[80];
--------------
}
}
process2(int counter)
{
char buff[80];
if(counter == 1)
{
--------
}
}
which one of the following is true
(a) both process require same stack space in all cases
(b) process 1 require more stack space
(c) process 2 require more stack space
(d) stack space for process is not allocated if counter == 1
answer is given as a option
4) consider the following statements
s1: evaluating the address of an object value after indirection is
simply object
s2:evaluating an object value from indirecting after taking its
address is not the object
which of the following is true
(a) only s1
(b) both are correct
(c) only s2 is correct
(d) both are wrong
answer is given as b option
5)which operation require more memory access
(a) branch
(b) conditional code test
(c) shift register right /* what is this ?*/
(d) all are same
answer is given as d option
well what do you folks think of all this stuff ?