(Paper) Latest Subex Fresher Job Interview Placement Paper (Campus Recruitment, Screening Test)

Latest Subex Fresher Job Interview Placement Paper (Campus Recruitment, Screening Test)

Company: SUBEX
Type :
Fresher, Job Interview

Dear friends Subex came in our campus on 27th Aug 2009. In Prelim round they asked following question which tried to collect for you.

It was of 20 marks and 30 min duration:
1.find the output.
Main()
{
char *n=”SUBEX”;
char *n=”FREDIX”;
printf(“%c”,*(++n));
n--; printf(“%c”,*n);
}

(a) FR         (b) RF         (c) RR         (d) segmentation fault (ans)

2.which on is showing constant pointer in following?
(a) const int * p;
(b) int * const p;(ans)
(c) int const *p;
(d) const int const *p;

3.Following is function declaration,so wat will be structure of the calling function?
typeit(char *p,int *i){...}

(a) typeit(ptr,&i);(ans)
(b) typeit(&ptr, &i);
(c) typeit(*ptr, *i);
(d) typeit(ptr[],i);

4.if there is an error in library function then which function is called to show the error?
(a) ferror();
(b) strerror(errornum);
(c) fprintf(“%s”,strerror(errornum));
(d) fprintf(stderr,”%s”,geterror());(ans)

Something like above option just check it.

5.find the output:-
main()
{
int a=5;
int y=-10;
int b=4;
int c=-2,k;
k=a + --y*c/b;
printf(“%d”,k);
}

(a) 5         (b) 6         (c) 10 (ans)        (d) 11 6

main()
{
int i=-1, j=-1, k=0, l=2, m;
m=i++&&j++&&k++||l++;
printf("%d %d %d %d %d",i,j,k,l,m);
}

Answer:
(a) 0 0 1 3 1(ans)
(b) 1 1 0 3 0
(c) 1 0 1 0 1
(d) none of these

Question7:-
#include main()
{ char s[]={'a','b','c','\n','c','\0'};
char *p,*str,*str1;
p=&s[3];
str=p;
str1=s;
printf("%d",++*p + ++*str1-32);
}

Answer:
(a)77 (ans)
(b) 78
(c)76
(d) none of these

Question 8:-
main()
{
int c[ ]={2.8,3.4,4,6.7,5};
int j,*p=c,*q=c;
for(j=0;j<5;j++)
{
printf(" %d ",*c);
++q;
} for(j=0;j<5;j++)
{
printf(" %d ",*p); ++p;
}
}

Answer:
(a) 2 2 2 2 2 2 3 4 6 5 (ans)
(b) 2 2 2 2 2 4 3 6 5
(c) 2 2 2 2 2 2 2 2 2
(d) none of these

9. What is difference between memcpy() and memmove()? option (b) overlapping stuffs

Question 10:-
main()
{
char *c=”hello/*””world*/!”;
printf(“%s”,c);
}

(a) hello
(b) hello world
(c) hello/*world*/ (ans)
(d) hello/*””world*/!”

Question 11:-
#define FIRST 7
#define LAST 5
#define SQUARE FIRST+LAST

main()
{
printf(“%d”,SQUARE*SQUARE);
}

(a) 144         (b) 47 (ans)         (c) 35         (d) none of theese

12.find the output:-
main()
{
int a=5,n;
(n=-(~a)+ ++a);
printf(“%d”,n);
}

(a) 10         (b) 11         (c) 12(ans)         (d) 13

Question 13:-
 main()
{
int *ptr[]={1,2,3,4,5};
*ptr+2=10;
for(i=0;i<5;i++)
printf(“%d”,ptr[i]);
}

(a) 1 2 3 4 5
(b) 1 2 10 4 5
(c)1 10 3 4 5
(d) error (ans)

Question 14:-
main()
{
char *str='a';
printf(“%c”,str);
printf(“%c”,(int *)str++);
}

(a) 97 97 (ans)
(b) 97 98
( c) 97
(d) error

Question 15:-
how do we get additonal 90 byte for the previously allocated memory for integer.
(a) ptr=realloc(ptr,90*sizeof(int)); (ans)
(b) ptr = realloc(ptr,100*sizeof(int));
(c) ptr = alloc (90*sizeof(nt));
(d) non of these

Question 16:-
main()
{ int i=10;
printf(“%d”,i<<4);
}

(a) 10         (b) 20         (c)40 (ans)         (d) 11

Question 17:-
main()
{
int arr[4][2],b=0;
for(i=0;i<4;i++)
for(j=0;j<2;j++) arr[i][j]=b++;
printf(“%d”,*(*(arr+1)+1));
}

(a) 2         (b) 3 (ans)         ( c) 5         (d) none of these

Question 18:-
main()
{
char *x=”happy”;
char *y,*p;
p=x;
*y=”birthday”;
p=y;
x=”hello jello”;
*y='d';
printf(“%s”,p);
}

(a) dirthday (ans)
(b) happy
(c) hello jello
(d) birthday

Question 19:-
How many time it will print??
void main()
{
printf(“subex”);
main();
}

(a)1 (ans)
(b) 2
(c) infinite
(d) none of these

Question 20:-
#define PRINTSUM(x,y,a) printf(#x “=%d” #z”=%d”,x,y);
main()
{
int a=2,b=3,c=4;
PRINTSUM (a,b,c);
a++, b++;
// some logival expr to increment the value c++; PRINTSUM(a,b,c);
}

(a) x=0 z=1 (ans)
(b) compilation error
(c) x=0 z=1 x=1 z=3
(d) segementation fault x=0 z=2 thats all they asked

Exam/Interview Date : 27-Aug-2009
Nos. of Rounds : Screeing Test