None of These
None of These
12;
int b=-123.12;
c=a+b;
printf("%2f",c);
a) 0.00
b) 123.12
c) 246.24
d) None of these
2. struct emp
{
int a;
char *name;
};
main()
{
struct emp *e;
printf("%d",sizeof(e));
}
ANs: 4
a) (i) only
b) (i),(ii) only
c) ii,iii only
d) iii only
4. consider the character array of size 10. When a string is more than 10
a) Error
b) Overwrites
c) Nothing
d) garbage value
5. main()
{
char *str;
char *fun();
str=fun();
printf("%s",str);
}
char * fun()
{
char *buffer;
strcpy(buffer,"Hello world");
return buffer;
}
a) hello world
b) Compiler error
c) Runtime error
d) None of the above
6. main()
{
char *str;
char *fun();
str=fun();
printf("%s",str);
}
char * fun()
{
char *buffer;
buffer=(char *) malloc(sizeof(char));
strcpy(buffer,"Hello world");
return buffer;
}
a) hello world
b) Compiler error
c) Runtime error
d) None of the above
7) what is the prefix expression for the given Infix expression A+B*C/D
8) int a;
a=65536;
printf("%d",a);
a) 0
b) Garbage
c) 65535
d) -32768
9) main()
{
char p=65;
printf("%c",p);
}
a) function body
b) Arguments
c) Return type
d) Declaration of function
a) /n
b) /t
c) /0
d) none
a) 127 to -128
b) 0 to 65535
c) Depend up on the compiler
d) -32768 to 32767
16) main()
{
int i,a[5];
a[1]=5;
for(i=0;i<5;i++)
{
printf("%d",a[i]);
a++;
}
a) 0 0 0 0 0
b) Garbage value
c) 0 5 0 0 0
d) Compiler error
17) The size of int is 2 bytes,then what is the size of short int?
a) 1
b) 2
c) 4
d) 8
19) which of the following statements are true in the case of doubly linked list
i) Every node is connected to other node
ii) We can traverse in both the directions
a) i) only
b)ii) only
c) Both i and ii
d) neither i nor ii
20) main()
{
char str[]="Wipro Infotech";
char *s;
s=&str[13]-13;
while(*s)
printf("%c",*s++);
}
a) Malayalam
b) malayalaM
c) error
d) None of the above
25) the size of a node od doubly linked list is always greater than the single linked list
a) True
b) false
26) Queue is used for
i) Expression Evaluation
ii) Scheluding the job in First come First serve
a) i) only
b) ii only
c) both i & ii
d) neither i nor ii
27) what should be replace ????? in the program to get the output 25?
?????
void main()
{
int x=2,y=3,j;
j=SQRT(x+y);
printf("%d",j);
}
main()
{
printf("%s",fun());
}
what will be the output?
30) main()
{
int i,j;
for(i=1,j=10;i<j;i++,j--);
printf("%d %d",i,j);
}
31) Which of these will pass the address of the pointer *ptr to the function demofun()?
a) demofun(ptr) b) demofun(&ptr)
c) demofun(*ptr) d) demofun(*&*ptr);
a) Queue Empty
b) Queue Full
c) Queue has one element
d) Queue has max-1 elements
a) i only
b) ii only
c) both i and ii
d) neither i nor ii
36) int *ptr;
ptr=(int *)calloc(10*sizeof(int));
which is correct?
i) All Values are intialised to zero
ii) Creates memory for 10 integer data
a) i only
b) ii only
c) both i and ii
d) neither i nor ii
a) q->rear[a]=item;
b) q->a[q->rear]=item;
c) q->a[rear]=item;
d) q->rear[q->a]=item;
38) In which of the following we can sort the data without moving the data
a) Array
b) Single Linked list
c) Doubly linked list
d) Binary search trees
a)128
b)-128
c) error
d) Garbage values
41) In a doubly linked list ,if the first node is first and the last node is end,what will be
the output?
traverse(struct node*end)
{
while(end!=NULL)
traverse(end->prev);
printf("%d",end->data);
}
a) 1,2,3,4,5
b) 5,4,3,2,1
c) compilation error
d) none
43) how will you refer the last node in the doubly linked list which is pointed by the
pointer variable 'cursor'?
a)cursor==NULL
b)cursor->link=NULL
c) Cursor->link=0
d) cursor->data=NULL
44) how will you refer the previous node of the pointer 'cursor' in the doubly linked list
(cursor is not in the first or in the last)?
a)cursor->link++
b)cursor=cursor->left
c) Cursor++
d) cursor->left++