30 technical and 30 aptitude and 60 min time. Technical section: its very easy any one can answer 25
qns without preperation. some are
1. How compiler treats variables of recursive functions
2. What is orthogonal matrix?
3. Given two tables and asked 2 qns on those table ,
4 One is on join and another is on NOT IN
5. Given some qns on pointers( pretty easy)
6. Given five qns on data structures like , lifo, fifo
7. Qtn on primary key
8. How NULL in sql is treated?
9. Given a doubly linked list and asked r->left->right->data ans: r->data
10: Explain const char *ptr and char *const ptr
11 Remaining i didn`t remember
Technical
1. What is the output of the following program? office:office" "
#include
#include
void main( )
{
int a=5,b=7;
printf(“%d\n”,b\a);
}
A. 1.4
B. 1.0
C. 1
D. 0
2. What is the output of the following program listing?
#include
void main ( )
{
int x,y:
y=5;
x=func(y++);
printf(“%s\n”,
(x==5)?”true”;”false”);
}
int func(int z)
{ if (z== 6)
return 5;
else
return 6;}
A True
B false
C either a or b
D neither a nor b
3. What is the output of the following progarm?
#include
main( )
{
x=4;
y=fact(x);
printf(“%d\n”,y);
}
unsigned int fact(int x)
{ return(x*fact(x-1));}
A. 24
B. 10
C. 4
D. none
4. Consider the following C program and chose collect answer
#include
void main( )
{
inta[10],k;
for(k=0;k<10;k++)
{ a[k]=k;}
printf (“%d\n”,k);
}
A. value of k is undefined ; unpredictable answer
B. 10
C. program terminates with run time error
D. 0
5. Consider the prog and select answer
#include
void main ( )
{
int k=4,j=0:
switch (k)
{ case 3: j=300;
case 4:
case 5: j=500;
}
printf (“%d\n”,j);
}
A. 300
B. 400
C. 500
D. 0
6. Consider the following statements:
Statement 1 A union is an object consisting of a sequence of named members of various types
Statement 2 A structure is a object that contains at different times, any one of the several members of
various types
Statement 3: C is a compiled as well as an interpretted language
Statement 4: It is impossible to declare a structure or union containing an instance of itself
A. all the statements are correct
B. except 4 all are correct
C. statemnt 3 is only correct
D. statement 1,3 are incorrect either 2 or 4 is correct
7. consider the following program listing and select the output
#include
main ( )
{
int a=010,sum=0,tracker:
for(tracker=0;tracker<=a;tracker++)
sum+=tracker;
printf(“ %d\n”,sum);}
A. 55
B. 36
C. 28
D. n
8.Spot the line numbers , that are valid according to the ANSI C standards?
Line 1: #include
Line 2: void main()
Line 3: {
4 : int *pia,ia;
5 :float *pafa,fa;
6 :ia=100;
7 :fa=12.05;
8 :*pfa=&ia;
9 :pfa=&ia;
10 :pia=pfa;
11 :fa=(float)*pia;
12 :fa=ia;
13 :}
a. 8 and 9
b. 9 and 10
c. 8 and 10
d. 10 and 11
8. What is the o/p of the follow pgm?
#include
main()
{
char char_arr[5]=”ORACL”;
char c=’E’;
prinf(“%s\n”,strcat(char_arr,c));
}
a:oracle
b. oracl
c.e
d.none
9. consider the following pgm listing
#include
main()
{
int a[3];
int *I;
a[0]=100;a[1]=200;a[2]=300;
I=a;
Printf(“%d\n”, ++*I);
Printf(“%d\n”, *++I);
Printf(“%d\n”, (*I)--);
Printf(“%d\n”, *I);
}
what is the o/p
a. 101,200,200,199
b. 200,201,201,100
c. 101,200,199,199
d. 200,300,200,100
10. which of the following correctly declares “My_var” as a pointer to a function that returns an integer
a. int*My_Var();
b. int*(My_Var());
c. int(*)My_Var();
d. int(*My_Var)();
11. what is the memory structure employed by recursive functions in a C pgm?
a. B tree
b. Hash table
c. Circular list
d. Stack
12. Consider the follow pgm listing?
Line 1: #include
2: void main()
3: {
4: int a=1;
5: const int c=2;
6: const int *p1=&c;
7: const int*p2=&a;
8: int *p3=&c;
9: int*p4=&a;
10:}what are the lines that cause compilation errors?
a.7
b.8
c.6 and 7
d.no errors
13. what will be the o/p
#include
main()
{
inta[3];
int *x;
int*y;
a[0]=0;a[1]=1;a[2]=2;
x=a++;
y=a;
printf(“%d %d\n”, x,(++y));
}
a. 0,1
b. 1,1
c. error
d. 1,2
what is the procedure for swapping a,b(assume that a,b and tmp are of the same type?
a. tmp=a; a=b;b=temp;
b. a=a+b;b=a-b;a=a-b;
c. a=a-b;b=a+b;a=b-a;
d. all of the above
Campus Interview Conducted in Surathkal on 11th July -2003
Test was of 1 hour 30 questions. g aptitude and 30 of technical.......some questions. of g aptitude were very
lengthy so don,t end up in solving them.....time was less......some 15 questions. from arithmetic......and rest 15
logical,statement interpretation,arrangement,tense correction......and like that......
1. Given a square matrix which consists only of 1 and 0......find which rows,which cols and which diagonals
consist entirely of 1,s.
2. Given an array of integers find all possible combinations of the numbers whose sum equal to 90.....
ans : knapsack problem (in data structures - aho ullman)
Note : for them solution was not the criteria.......but the approach was important......the solution should
be generalised and optimized........optimization was given the top priority........
Techincal paper
1. const int MAX=10;
main()
{
enum a {a,b,MAX};
print MAX;
}
ans. 2
2. enum variable is a const variable which can only be assigned a value at initialization or a non const variable which
can be assigned any value in the middle of the program?
ans. const variable
3. void *p; what operation cannot be performed on p?
ans : arithmetic operation unless it is properly typecasted
4. char **p="Hello";
print p,*p,**p
ans. Hello (null)
warning: suspicious pointer conversion
5. main()
{
char str[]="Geneius";
print (str);
}
print(char *s)
{ if(*s)
print(++s);
printf("%c",*s);
}
ans. suiene
6. what does the function fcloseall() does ?
ans. fcloseall() closes all open streams except stdin,stdout,stderr,stdprn and stdaux
7. main()
{
printf("Genius %d",fun(123));
}
fun(int n)
{
return (printf("%d",n));
}
ans. 123genius3
8. difference between definition and declaration. ans. definition once while declaration more than once
9. find the error?
main()
{ void fun();
fun();
}
void fun()
{
int i=10;
if(i<10)
return 2.0;
return 3.0;
}
ans. no error but warning
10. int a=9,b=5,c=3,d;
d=(b-c)<(c-a) ? a : b;
print d
ans 5
11. 1+2/3*4+1=? Ans. 2
12. In C++, a variable can be defined wherever needed whereas not in C
13. main()
{
int i=4;
fun(i=i/4);
print i;
}
fun(int i)
{
return i/2;
}
ans 1
14. what is an array ?
ans. contiguous collection of memory occupied by similar data types
15. printf("\"NITK %%SURAHKAL%% !\"");
ans. "NITK %SURATHKAL% !"
16. difference between scanf and gets in case of string input
ans. scanf does not accepts white space while gets does
17. table t1 m rows and x cols table t2 n rows and y cols
in t1*t2 rows? cols=?
ans. m*n ,x+y
18. symbol of realtionship between 2 entities?
19. which one cannot come in data modelling
a. customer b. student c. office d. speed
ans speed
20. can a database table exist without a primary key ?
21. whether higher normal forms better than lower forms as far redundancy is concerned ?
ans. higher
22. file is at which level
ans. conceptual level
ans. primary key in some other table
No comments:
Post a Comment