C Programming and Problem Solving
Questions 351 to 360
351.
|
Find the
output of the following program
int
main()
{
increment();
increment();
increment();
}
increment()
{
static
int i=0;
i=i+1;
printf(“%d”,i);
}
|
||||||||||
What is
the value of a in following expression a=(3<5)?(4<6)?6:7:8;?
|
|||||||||||
The
declaration int (*a)[8] is
|
|||||||||||
What is dangling pointer?
|
|||||||||||
What is
difference between *p++ and ++*p?
|
|||||||||||
int a = 10, b = 20, c = 30, d = 40;
printf("
%d ", a ^ b & c | d );
What is
the output for the above code?
|
|||||||||||
Which one of the following functions
is the correct choice for moving blocks of binary data that are of arbitrary
size and position in memory?
|
|||||||||||
What is difference between gets()
and fgets()?
|
|||||||||||
Find the
output of the following program
union emp
{
int
eno;
char name[10];
int sal;
};
struct emp1
{
int
eno;
char name[10];
int sal;
};
int main()
{
struct emp e1;
union emp1 e2;
printf(“%d%d”sizeof(e1),sizeof(e2));
}
|
|||||||||||
What is the Difference between
open() and fopen() function?
|
Answers
351.
|
Answer : (e)
Reason : static
variables are initialize only once and life of variable exist b
etween
two function calls
|
Answer : (d)
Reason : ?:
are ternary operators.
|
|
Answer : (b)
Reason : a
is a pointer points to array of 10 integers.
|
|
Answer : (b)
Reason : Dangling
pointer points to dealloated memory area .
|
|
Answer : (c)
Reason : *p++
is equal to *(p++) and ++*p equal to ++(*p).
|
|
Answer : (a)
Reason : ^
is XOR operator & AND operator | OR operator
|
|
Answer : (a)
Reason : memory
managemt functions operate on block of memory area
|
|
Answer : (c)
Reason : gets is macro and fgets is function.
|
|
Answer : (d)
Reason : structure
allocate memory for all the structure elements
but unions allocate memory for
the element which is having maximum size
|
|
Answer : (c)
Reason : open
function open file without streams but fopen
function open file with streams
|
<< Prev 1... 2... 3... 4... 5... 6... 7... 8... 9... 10... 11...
12... 13... 14... 15... 16... 17... 18... 19... 20... 21... 22... 23... 24... 25... 26... 27... 28... 29... 30... 31... 32... 33... 34... 35... 36...
thank you.
ReplyDeletec++ tutorial
java tutorial