Sample Test Paper :Alter Engineering int b=10;
int *p=&b; *p++;
printf("%d",*p); what is the output?
What is the difference between malloc, calloc and realloc? What does malloc return in C and C++?
main() { char *a="hello"; char *b="bye"; char *c="hai"; int x=10,y=100; c=(x<y>)?a:b; printf("%s",c); }
whats the output? void main() { int a,b; a=sumdig(123); b=sumdig(123); printf("%d %d",a,b); } int sumdig(int n) {
static int sum; int d; if(n!=0) { d=n%10; n=(n-d)/10; sum=sum+d; sumdig(n); } else return s; }
what is the output?
Declare a pointer to a function that takes a char pointer as argument and returns a void pointer.
How do we open a binary file in Read/Write mode in C? C++ class A { public: A() { } ~A(); }; class derived:public A { derived(); };
what is wrong with this type of declaration? what do you mean by exception handling? What are "pure virtual" functions?
What is the difference between member functions and static member functions?
What is the4 difference between delete[] and delete? Question on Copy constructor.
What are namespaces? One question on namespace.
What are pass by valu and pass by reference? what is the disadvantage of pass by value?
I didnt get this. if you have the answer plz tell me. How to invoke a C function using a C++ program? char *str;
sscanf(str1,"%s",str); what is the output?
Difference between function overloading and function overriding. There is a base class sub, with a member function fnsub(). There are two classes super1 and super2 which are subclasses of the base class sub. if and pointer object is created of the class sub which points to any of the two classes super1 and super2, if fnsub() is called which one will be inoked?
View Comments Enter Your Comments
...
Ads by Google
Satyam Hiring Freshers. 100's of Satyam Jobs
Submit your Resume Free. Now MonsterIndia.com
C++ Source Codes
C++ Codes, Projects, Examples Free Download
www.cppfaqs.com Array
C, C++, and C# Resources. Find tutorials, tips, and reviews. www.DevSource.com
Infosys Test
Wanted Experienced Professionals Post Your Resume Free & Get Placed! ClickJobs.com/Post-CV
NetApp® and VMware®
Working Together to Deliver Virtual Solutions to Your Business
www.NetApp.com/IN TaqMan Low Density Array
Find TaqMan® Low Density Arrays. Customize & Order Online Today! www.AppliedBiosystems.com Test Paper :1
Paper Type : Technical - C & C++ Posted By : admin
Give the output of the programs in each case unless mentioned otherwise void main() { int d=5; printf("%f",d); }Ans: Undefined void main() { int i; for(i=1;i<4,i++) switch(i) case 1: printf("%d",i);break; { case 2:printf("%d",i);break; case 3:printf("%d",i);break; }
switch(i) case 4:printf("%d",i); }Ans: 1,2,3,4 void main() { char *s="\12345s\n"; printf("%d",sizeof(s)); }Ans: 6 void main() {
unsigned i=1; /* unsigned char k= -1 => k=255; */ signed j=-1; /* char k= -1 => k=65535 */
/* unsigned or signed int k= -1 =>k=65535 */ if(i<j) printf("less"); else if(i>j) printf("greater"); else
if(i==j) printf("equal"); }Ans: less void main() { float j; j=1000*1000; printf("%f",j); } 1. 1000000 2. Overflow 3. Error 4. None Ans: 4
How do you declare an array of N pointers to functions returning pointers to functions returning pointers to characters? Ans: The first part of this question can be answered in at least three ways:
Build the declaration up incrementally, using typedefs: typedef char *pc; /* pointer to char */
typedef pc fpc(); /* function returning pointer to char */ typedef fpc *pfpc; /* pointer to above */
typedef pfpc fpfpc(); /* function returning... */ typedef fpfpc *pfpfpc; /* pointer to... */ pfpfpc a[N]; /* array of... */
Use the cdecl program, which turns English into C and vice versa:
cdecl> declare a as array of pointer to function returning pointer to function returning pointer to char char *(*(*a[])())()
cdecl can also explain complicated declarations, help with casts, and indicate which set of parentheses the arguments go in (for complicated function definitions, like the one above). Any good book on C should explain how to read these complicated C
declarations "inside out" to understand them ("declaration mimics use"). The pointer-to-function declarations in the examples above have not included parameter type
information. When the parameters have complicated types, declarations can *really* get messy. (Modern versions of cdecl can help here, too.)
A structure pointer is defined of the type time . With 3 fields min,sec hours having pointers to intergers.
Write the way to initialize the 2nd element to 10.
In the above question an array of pointers is declared. Write the statement to initialize the 3rd element of the 2 element to 10
int f() void main() { f(1); f(1,2); f(1,2,3); }
f(int i,int j,int k) {
printf("%d %d %d",i,j,k);
}What are the number of syntax errors in the above? Ans: None. void main() { int i=7; printf("%d",i++*i++); }Ans: 56 #define one 0 #ifdef one printf("one is defined "); #ifndef one
printf("one is not defined "); Ans: "one is defined"
void main() { intcount=10,*temp,sum=0; temp=&count; *temp=20; temp=∑ *temp=count; printf("%d %d %d ",count,*temp,sum); } Ans: 20 20 20
There was question in c working only on unix machine with pattern matching.
what is alloca() Ans : It allocates and frees memory after use/after getting out of scope main()
{
static i=3; printf("%d",i--);
return i>0 ? main():0; } Ans: 321 char *foo() { char result[100]); strcpy(result,"anything is good"); return(result); } void main() { char *j; j=foo() printf("%s",j); }
Ans: anything is good. void main() { char *s[]={ "dharma","hewlett-packard","siemens","ibm"}; char **p; p=s; printf("%s",++*p); printf("%s",*p++); printf("%s",++*p);
}Ans: "harma" (p->add(dharma) && (*p)->harma)
"harma" (after printing, p->add(hewlett-packard) &&(*p)->harma) "ewlett-packard" ... i2 Technologies Q1.Convert 0.9375 to binary a) 0.0111 b) 0.1011 c) 0.1111 d) none Ans. (c) Q2.( 1a00 * 10b )/ 1010 = 100 a) a=0, b=0 b)a=0, b=1 c) none Ans. (b)
Q3. In 32 bit memory machine 24 bits for mantissa and 8 bits for exponent. To increase the range of floating point.
a) more than 32 bit is to be there.
b) increase 1 bit for mantissa and decrease 1 bit for exponent c) increase 1 bit for exponent and decrease one bit for mantissa Q4.In C, "X ? Y : Z " is equal to
a) if (X==0) Y ;else Z b) if (X!=0) Y ;else Z c) if (X==0) Y ; Z Ans. (b)
Q5. From the following program foo()
int foo(int a, int b) {
if (a&b) return 1; return 0;
}
a) if either a or b are zero returns always 0 b) if both a & b are non zero returns always 1 c) if both a and b are negative returns 0
Q6. The following function gives some error. What changes have to be made void ( int a,int b)
{
int t; t=a; a=b; b=t; }
a) define void as int and write return t b) change everywhere a to *a and b to *b Q7. Which of the following is incorrect
a) if a and b are defined as int arrays then (a==b) can never be true b) parameters are passed to functions only by values
c) defining functions in nested loops Q8. include<stdio.h>
void swap(int*,int*); main()
{
int arr[8]={36,8,97,0,161,164,3,9} for (int i=0; i<7; i++)
{
for (int j=i+1; j<8;j++)
} }
void swap(int*x,int*y) {
int temp; static int cnt=0; temp= *x; *x=*y; *y=temp; cnt++; } What is cnt equal to a) 7 b) 15 c) 1 d) none of these Q9. int main() { FILE *fp; fp=fopen("test.dat","w"); fprintf(fp,'hello\n"); fclose(fp); fp=fopen ("test.dat","w"); fprintf (fp, "world"); fclose(fp); return 0; }
If text.dat file is already present after compiling and execution how many bytes does the file occupy ? a) 0 bytes b) 5 bytes c) 11 bytes d) data is insufficient Q10. f1(int*x,intflag) int *y; *y=*x+3; switch(flag) { case 0: *x=*y+1; break; case 1:
*x=*y; break; case 2: *x=*y-1; break; } return(*y) main() { *x=5; i=f1(x,0); j=f1(x,1); printf("%d %d %d ",i,j,*x); }
What is the output? a) 8 8 8
b) 5 8 8 c) 8 5 8
d) none of these
Enter Your Comments
///////////
part 1 of paper
first aptitude having five sections (50 questions and 45 minutes) part 2
second c debugging (test ur c skills - yashwant kanitkar)(questions 20 time 30 min.) paper 1
section one
15 questions (data sufficiency) a alone is sufficient
b alone is sufficient a and b are both sufficient a and b both are insufficient
section two
five questions (reading comprehence ) very easy
section three
15 questions (logical reasoning)
a pare is given and some hints are given u can fine out the ans
one hotel has two zones (east and west) not all east zone flats have ocean view but all weat zone flats have harbour view all ocean view flats has extra charge in harbour view flats above and on 3rd floor have extra charge west zone flats lower than 3rd floor some has kitchen so extra charge all other flats of east zone not having ocean view has kitchen so extra charges
section four
10 questions verbal reasoning four or five sentences are given related to single topic four options are given which are having order of three sentences(abe or bec) select correct order
sections five
five computational questions which were easy
* total 12 members half are in club a one third in b and one fourth in c how many are not in any club
ans 5(check)
these type of questions u can find in R. S. Agrawal
or IMS package of CAT
in question it was written that all five sections carry their cutoffs so attempt all but in electrical one guy was selected who didnot attempt reading comprehension but attempted all 45 questions this paper also has negative marking of 50%
paper 2
1.what does p in const char *p stands for
2.main() sturct date { char name[20]; int age ; float sal; };
sturct data d ={"rajesh"}; printf("%d%f",d.age,d.sal); }
tell the output 3.main() int i=7; printf("%d"i++*i++); output 4.void main() { int d ; int i=10; d =sizeof(++i); printf("%d"); output 5.difference between extern int f(); int f(); 6.choose correct
(i)stack is automatically cleared (ii)heap is automatically cleared (iii)user has to clear stack and heap (iv)system takes care of --- 7. What'll be the output:
main() {char *a,*f(); a=f(); printf("%s",a); } char *f() {return("Hello World"); 8.What'll be the output: main()
{char*a,*f(); a=char*malloc(20*sizeof(char)); a=f(); printf("%s",a); } char *f() {char n[20]; strcpy(n,"Hello World"); return(n); }
9.What is the error : main() {int j=10; switch(j) { case 20: pritnf("Less than 20"); break; case 30: printf("Less than 30"); break; default: printf("hello"); } 10.which is valid : (i)char arr[10]; arr="hello";
(ii) char arr[]="hello"; 11. main() { char *str; str=char*malloc(20*sizeof(char)); strcpy(str,"test"); strcat(str,'!'); printf("%s",str); }
12. How many times main is get called : main()
{
printf("Jumboree"); main();
}
13. Which statement is true about main :
(i) Varible no. of Arguments can be passed main. (ii) Main can be called from main();
(iii) We can't pass arguments are passed in main (iv) main always returns an int
14. Output ? main() { int i,j; for(i=0,j=0;i<5,j<25;i++,j++); printf("%d %d",i,j); } 15.main() { int i;
if(i=0) //it's assisnment not logical operator printf(" Hell ");
else
printf("Heaven"); like this
no negative marking and more than one answers but paper I is cutoff paper i think c paper will not be checked
Interview
they will give u puzzles in first round which will be from site techinterview.org this site has 70 puzzles and their answers so go through them
second round has c coding of data structure circular quese,tree etc also questions from c and c++ like virtual functions
far near huge memory concepts like heap,stack etc
then in third round hr questions like hobbies and interets make ur curriculam vite and bring it with ur file
they want people with good aptitude in interview rounds ur aptitude and approach matters so solve puzzles.
Enter Your Comments ///////////
20 c objective Qs to be answered in 30 minutes
All questions are related to basic c concepts like expression, arrays, loops ,structure , pointers around 3 or 4 qs on array with loops
Since paper is very easy cutoff is very high.
They will select 20% of the student for the interview after written test. Freshersworld.com
point to remember. Each correct ans 1 marks
Each wrong answer 1 -ve mark Sample Paper
Some of the questions will not have answers .Please forgive us.
1. Difference b/n scanf("%s",msg);and scanf("%[\^n]",msg); where msg is a char array. 2. What is ure of comma operator in for loop.
3. int shw(int *a){ *a = 10; /* return stmt is missing */ } main(){ int p=3,q=4; q = shw(&p); printf("%d %d",p,q); } 4. which is true
a. all automatic variables are declared with in the function b. all variables are automatic
c. all not declared variables are automatic d. none
5. What is recursion. Recursive prog to generate Fibonacci series . Is it a best method? 6. write 7*a interms of +,-,<<
7. count number of 1's in a 32 bit integer.(i had not remembered whether array or integer).
8. main(){
char *s1 = "hello",*s2 ="abce"; strcpy(s1,"");
s2[0] = s1[0];
printf("%d%d",strlen(s1),strlen(s2)); }
10.Algorithm to delete a node in Double linked list. 11. Difference b/n fgets,fscanf which u will prefer. Unix
11.What is creon and whats diff b/n 'at' command.
12. what is system call and lib function. whats diff b/n them. abt execve - expalin. 13.some thing abt makeall
14. write abt TCP,IP,ICMP Enter Your Comments ////////// TRIAD
mostly triad is only for mech guys only TRIAD PAPER
C - language:
1. write a program to calculate ncr
2. write a program to exchange the values of two variables using pointers
3. write program to open one file input some numbers and find smallest,largest, avg. and store them in another file.
4. write a structure node using linked list
5. write a program to reverse a string co-ordinate geometry
1. find the perpendicular distance from a point P(a,b) to a line lx+my+n=0; 2. y=x^3+2x^2+5x+2 find the slope of this eqn when x=12;
( Hint :find dy/dx and substitute x=12)
3. circle is x^2+y^2=a^2 . if the centre is shifted to (25,16) what is the eqn of new cirlce. 4. pt rotation P(x,y) about origin in anticlockwise direction by an angle theta. find new coordinates.
before this there will be some question on puzzles(gre barrons). prepare co-ordinate geometry and fundamental of c.
regarding interview :
ans:say no, not interested.
2. tell some project works that r done and or going to be do in c , c++, 3. personal interview.
4. be perfect in c, they r asking that how u done this in test paper.
5.they ask u do be agree to the company bond. bond is for 3 years , breaking is at cost of 50,000.
apptitude ;
some puzzles r given around 9, study well it is easy, for it they provide 20 min00110 /////////
Prodex Paper 1.x=3
function(++x)...value 4 is passed to the function 2 x=3
function(x++)...value 3 is passed to the function 3.some ques on file opening...
if(name)..(exixts) {
...
} the file can be opened 4.if(!name)...(not exixts) {
...
} the file cant b opened
5. a for loop ques does not print array...condition not satisfied a[10]={10,14,18,20}
6.another for loop ques prints correctly...condition satisfied 7.main()
{
}
void function(int *x,int *y) {
... }
the function does not work. 8.A d();
a j;
it works well
Enter Your Comments ///////// Texas Instruments
Date : 8/9/2005
given an expression tree and asked us to write the in fix of that expression four choices : 2
global variables in different files are a:at compiletime b) loading time c) linking time d)execution time size of(int) a) always 2 bytes
b) depends on compiler that is being used c) always 32 bits
d) can't tell
which one will over flow given two programs 2 prog 1: prog2:
main() main() { {
int fact; int fact=0
long int x; for(i=1;i<=n;i++) fact=factoral(x); fact=fact*i; } }
int factorial(long int x) { if(x>1) return(x*factorial(x-1); } a) program 1; b) program 2; c) both 1 &2
d) none }
variables of fuction call are allocated in a) registers and stack
b) registers and heap c) stack and heap d)
avg and worst case time of sorted binary tree data structure used for proority queue
a) linked list b) double linkedd list c)array d) tree main(){
char str[5]="hello";
if(str==NULL) printf("string null"); else printf("string not null");
}
what is out put of the program?
a) string is null b) string is not null c) error in program d) it executes but print nothing There are 0ne 5 pipe line and another 12 pipe line sates are there and flushed time taken to execute five instructions a) 10,17
b) 9,16 c)25,144 d)
for hashing which is best on terms of buckets a)100 b)50 c)21 d)32 ans 32
void f(int value){ for (i=0;i<16;i++){
if(value &0x8000>>1) printf("1") else printf("0");
} }
what is printed?
a) bineray value of argument b)bcd value c) hex value d) octal value void f(int *p){ static val=100; val=&p; } main(){ int a=10;
printf("%d ",a); f(&a);
printf("%d ",a); }
what will be out put? a)10,10 struck a{ int x; float y; char c[10]; } union b{ int x; float y; char c[10]; } which is true? a) size of(a)!=sizeof(b); b) c) d)
# define f(a,b) a+b #defiune g(c,d) c*d find valueof f(4,g(5,6)) a)26 b)51 c) d)
find avg access time of cache a)tc*h+(1-h)*tm b)tcH+tmH
c) d) tc is time to access cache tm is time to access when miss occure main() { char a[10]="hello"; strcpy(a,'\0'); printf("%s",a); }
out put of the program?
a) string is null b) string is not null c) program error d) simplyfy k map
1 x x 0 1 x 0 1 int f(int a)
{ a=+b; //some stuff } main() { x=fn(a); y=&fn;
what are x & y types
a) x is int y is pointer to afunction which takes integer value char a[5][15];
int b[5][15];
address of a 0x1000 and b is 0x2000 find address of a[3][4] and b[3][4] assume char is 8 bits and int is 32 bits
a) b) c) d)
there are 20 questions all in techinical paper and 36 questions in appititude test in
appititude thay have given all diagrams and asked to find what comes next thay are quite easy and i hope if u practice r.s aggraval u can do it easily for tecnical thay have given 1 hr for 20 questions and for not technical thay have given only 40 min and 36 questions this is the paper i have right now for TI aptitude test consist of all pictorial questions. ie in each question he will give 8 diagrams and ask to find th 9'th diagram in that
sequence.You go through RS Agarwal. These aptitude questins are
very easy. Just pratice them. In RS Agarwal gothrough SERIES chapter. It is suffient. There are 35 aptitude
questions. First 25 are very easy. Do these questions in just 15 or 20 minutes. Because last questions are
very touch.
TECHNICAL TEST:
3 flipflops are connected so that after 0 to 5 count occured next number is zero. So what is the counter?
Ans: mod 6 counter
simplication of some boolean expression which is simple. Boolean Expression is A+A'B. Ans:A+B
Given inorder sequence and preorder sequence and asked to find out postorder sequence. Some question on value of a static variable.
Given an interger in binary form,find the number of ones in that number without counting each bit.(This questin is not multiple choice question. This question carries more marks. So please take care for this question.)
called---a)direct b)something c)1-way set associative 4)something Ans: c
Fastest IPC mechanism is
a)shared memory b)pipes c)named pipes d)semaphores Ans:c
Some page references are given. You are asked to implement it with Least Frequently Used algorithm.
Some diagram is given. Iam describinmg the diagram. A 2*1 MUX is given. The inputs are A,B. Output is C. C and A are tied together. What is the diagram.?
Ans:Latch.
This paper is for Electrical & Electronics students. There is separate test for computer Science Students. There are 20 questions.
1)Some circuit is given. Iam describing the circuit.A resistor R & a capacitor C are connected in parallel.
To this circuit another circuit which is having a capacitorof capacity 2C & an impedence Z, is connected in series.
You are asked to find out the value of Z? Note that 2C & Zare connected in series. a)Z=2C
b)Z=2L c)Z=L/2 d)Z=2R
Some circuit which consist of only resistors R is given. This is a repetative circuit. U have to find the effctive
resistance of the entire circuit. A)Rin=R
B)Rin=(5+sqrt(3))/7 C)Rin=(19+sqrt(3))/8 D)None.
Two wave forms are given. You are asked to write the cirsuit to get B(second wave form) from A(first wave form).
#define SUM(a,b) a+b main()
{ a=2; b=3;
x=SUM(a,b)*2; printf("x=%d\n",x); } Ans:8. number(int i) { number++; printf("%d\n",number); } main() {
static int i=0; number(i); }
Ans: I don't know.
Some circuit is given. I can't describe the circuit. There are 3 resistors,3 capacitors & one inverter.. The question is
What is the value of the frequency such that the circuit oscillates. A)f=RC
B)f=sqrt(3)/(Pi*R*C) C)f=1/(Pi*R*C) D)something
Ans:I don't know the answer.
7)Question on flipflop. So gothrough all flipflops. 8)There are 5 questions on Nmos & Pmos circuits.
This Paper is for Computer Science Students. THis paper is very easy. You can definitely do it in one hour.
The fastest memory is
(i) DRAM, (ii) ROM, (iii) SRAM, (iv) Main memory Ans : SRAM
Programing exceptions are
(i) Asynchronous, (ii) Synchronous, (iii) None Ans : Asynchronous
DSP which architecture is used
(i) MIMD, (ii) SIMD, (iii) Nueman, (iv) Harvard Architecture Ans : Harvard Architecture
main() {
unsigned char i; int sum;
for(i=0; i<300; i++) sum+ = i;
printf("\nSum = %d\n", sum); }
Ans : infinite loop void fn(int *p) {
static int val = 100; p = &val; } main() { int i=10; printf("i=%d\n", i); fn(&i); printf("i=%d\n", i); }
Ans : i=10 i=10 int a[10[15]; char b[10[15];
(a) location g a[3][4], if base location g a[0][0] is ox1000 (b) location g b[3][4], if base location g b[0][0] is ox2000 int taken 32 bits and char taken 8 bits.
Ans : (a) ox10C4 (b) ox2031
Implement OR gate function with 2*1 MUX Ans : A ___________ ---|2*1 MUX | B | |---o/p ---| | | ---|_______|C B=C
Implement 4*1 MUX with 2*1 MUXES
Swapping without using a temporary variables. (2 methods) (i) x = x+y;
y = x-y; x = x-y; (ii) x = x^y; y = x^y; x = x^y;
Count no of 1's in a word without using bit by bit. (This question carries more marks. It is not a multiple choice
question. Code 1 :
for(i=0; i<1000; i++) for(j=0; j<100; j++) x = y;
Code 2 :
for(i=0; i<100; i++) for(j=0; j<1000; j++) x = y;
Which code will execute faster
(i) Code 1 and Code 2 are of same speed, (ii) Code 1, (iii) Code 2, (iv) None. Ans : Code 2 main() {
int a[10] = {1, 2, 3, ...., 10}, i, x=10, temp; for(i=0; itemp = a[i];
a[i] = a[x-i-1]; a[x-i-1] = temp; }
(i) All contents of array a are reversed (ii) Only some portions are altered (iii) Remains same
(iv) None Ans : (iii)
An array is stored in row major order. The memory capacity is 30 MB. And in unix system demand paging is used. Which one will give more page faults?
#define V_L_I 10000
int i, j, array[V_L_I][V_L_I]; Code 1 :
array[i][j] = 1; Code 1 :
Ans : Code 2
In C which parameter passing technique is used? (i) call by value,
(ii) call by reference, (iii) both
Ans : call by value
A circuit is given with 2 exclusive OR gates whose boolean expression will be y = '(AB) + AB (' indicates bar) (17) main() { int i = 1; fork(); fork(); printf("\ni = %d\n", i+1); }
Ans : 4 printfs will occur and i = 2
Compute the complexity of Binary search.
Ans : O(lg n) ( Answer in detail. This is not a multiple choice question. It carries more marks.)
Write expression for the tree graph : Ans : ((a-b) + c*d)/x
# define MAX(a, b) a>b ? a:b main() { int m, n; m = 3 + MAX(2, 3); n = 2 * MAX(3, 2); printf("m = %d, n = %d\n", m, n) } Ans : m=2, n=3
Enter Your Comments
///////// Ramco
Directions: Each of the following question has a question and two statements labelled as (i) and (ii). Use the data/information given in (i) and (ii) to decide whether the data are sufficient to answer the question record your answer as
A) If you can get the answer from (1)alone but not from (2) B) If you can get the answer from (2)alone but not from (1)
C) If can get the answer from (1)and (2)together ,although neither statement by itself suffice
D) If statement (1)alone suffices and statement (2) alone also suffice.
E) If can't get the answer from statements (1) and (2) together and you need more data. What will be the population of city X in 1991?
1) Population of the city has 55% annual growth rate 2) in 1991,the population of city X was 8 million Ans:C
Was it Rani's birthday yesterday? 1)Lata spends Rs.100 on Rani's birthday 2)Lata spent Rs.100 yesterdayAns: E
Is 3*5 or is 4*6 greater ? 1) a*b =b*a
2) a*b is the remainder of ab%(a+b) Ans:B
Will the graph X-Y pass through the origin? 1) x proportional to the Y
2)increment in y per units rise of x is fixed. Ans:E
What was the value of the machine 2 years ago?
1) the deprecition of the value of the machine per year is 10% 2)present value of the machine is rs 8000/
Ans:C
What will be the area of a square that can be inscribed in a circle? 1) Radius of the circle is T
2) Length of a diagonal of the square is 2r Ans:D
There are two figures viz., a circle and a square. Which having greater area? 1) Perimeter of the circle is the same as the perimeter of the square.
2) Eleven times the radius is equal to seven times the length of one side of the square. Ans: D
A candidate who was found to be under weightin medical test had been selected
provisionally subject to his attainment of 60Kg weight within one year. What should be the percentage increase of his weightso that selection is confirmed after one year. 1) Weight (Kg)=16+8 Height (ft) is standard equation for the Indian population. The candidates height is 5.5
2) His present weight is 55Kg. Ans: D
Is angle µ=90
1) sin**2(µ)+cos**2(µ)=1 2) sin**2(µ)-+cos**2(µ)=1 Ans: E
What will be the average age of workers of an Institution after two years? 1) Present average age is 35 years
2) There are total 20 workers in the Institution Ans: A
Is AB>AM ( A Triangle is given ) 1) AB<AC
2) M is any point other than B and C on BC Ans: E
Is X^2+Y^2<X+Y? 1) 0<X<1
2) 0<Y<1 and X!=Y (X not equal to Y) Ans: C
Can it be concluded that angle ABO = angle ODC
1) ABCD is a Parallelogram and O is the point of intersection of the diagonals. 2) Angle DOC =75deg. and angle DAO =35deg.
What is the value of x+y? 1) 2y=x+6
2) 5x=10y-30 Ans: E
How many students are there in the class?
1) 30 students play foot ball and 40 play cricket . 2)Each student plays either foot ball or cricket or both. Ans: E
What is the value of a:b? 1) a=x+10%ofx
2) b=a+10%ofa Ans: B
What is the maximum value of the expression 5+8x-8x^2? 1) x is real
2) x is not positive Ans: C
What will be the value of the greatest angle of the triangle ABC? 1) Angles of the triangle are in the ration 2:5:3
2) The side opposite to the greatest angle is the longest side. Ans: A
What is the range of values of x? 1)( x-2 ) / ( 2x + 5 ) < 1/3
2)2x /3 + 17/3 > 3x - 20 Ans: D
Of the two which one is the greater -- -3/x , -3/y? 1) x,y>0 <![endif]>
Technical Questions
Find the output for the following C program main()
{
char *p2;
p2=(char *)malloc(20); while(*p2++=*p1++); printf("%s\n",p2); }
Ans. An empty string
Find the output for the following C program main() { int x=20,y=35; x = y++ + x++; y = ++y + ++x; printf("%d %d\n",x,y); } Ans. 57 94
Find the output for the following C program main() { int x=5; printf("%d %d %d\n",x,x<<2,x>>2); } Ans. 5 20 1
Find the output for the following C program #define swap1(a,b) a=a+b;b=a-b;a=a-b; main() { int x=5,y=10; swap1(x,y); printf("%d %d\n",x,y); swap2(x,y); printf("%d %d\n",x,y); }
int swap2(int a,int b) { int temp; temp=a; b=a; a=temp; return; }
Ans. 10 5
Find the output for the following C program main()
{
char *ptr = "Ramco Systems"; (*ptr)++;
printf("%s\n",ptr); ptr++;
printf("%s\n",ptr); }
Ans. Samco Systems
Find the output for the following C program #include<stdio.h> main() { char s1[]="Ramco"; char s2[]="Systems"; s1=s2; printf("%s",s1); }
Ans. Compilation error giving it cannot be an modifiable 'lvalue' Find the output for the following C program
#include<stdio.h> main() { char *p1; char *p2; p1=(char *) malloc(25); p2=(char *) malloc(25); strcpy(p1,"Ramco"); strcpy(p2,"Systems"); strcat(p1,p2); printf("%s",p1); } Ans. RamcoSystems
Find the output for the following C program given that [1]. The following variable is available in file1.c static int average_float;
Find the output for the following C program # define TRUE 0 some code while(TRUE) { some code }
Ans. This won't go into the loop as TRUE is defined as 0 Find the output for the following C program
main() { int x=10; x++; change_value(x); x++; Modify_value(); printf("First output: %d\n",x); } x++; change_value(x); printf("Second Output : %d\n",x); Modify_value(x); printf("Third Output : %d\n",x); } Modify_value() { return (x+=10); } change_value() { return(x+=1); } Ans. 12 1 1
Find the output for the following C program main()
{
int x=10,y=15; x=x++;
y=++y;
printf("%d %d\n",x,y); }
Ans. 11 16
Find the output for the following C programmain() {
int a=0;
if(a=0) printf("Ramco Systems\n"); printf("Ramco Systems\n");
}
Ans. Ony one time "Ramco Systems" will be printed
Find the output for the following C program #include<stdio.h>
int SumElement(int *,int); void main(void) { int x[10]; int i=10; for(;i;) { i--; *(x+i)=i; } printf("%d",SumElement(x,10)); }
int SumElement(int array[],int size) { int i=0; float sum=0; for(;i<size;i++) sum+=array[i]; return sum; }
Find the output for the following C program #include<stdio.h>
void main(void);
int printf(const char*,...); void main(void)
{
int i=100,j=10,k=20; -- int sum;
float ave; char myformat[]="ave=%.2f"; sum=i+j+k; ave=sum/3.0; printf(myformat,ave); }
Find the output for the following C program #include<stdio.h> void main(void); { int a[10]; printf("%d",((a+9) + (a+1))); }
Find the output for the following C program #include<stdio.h> void main(void) { struct s{ int x; float y; }s1={25,45.00}; union u{ int x; float y; } u1; u1=(union u)s1;
printf("%d and %f",u1.x,u1.y); }
Find the output for the following C program #include<stdio.h> void main(void) { unsigned int c; unsigned x=0x3; scanf("%u",&c); switch(c&x) { case 3: printf("Hello!\t"); case 2: printf("Welcome\t"); case 1: printf("To All\t");
default:printf("\n"); }
}
Find the output for the following C program #include<stdio.h> int fn(void); void print(int,int(*)()); int i=10; void main(void) { int i=20; print(i,fn); }
void print(int i,int (*fn1)()) { printf("%d\n",(*fn1)()); } int fn(void) { return(i-=5); }
Find the output for the following C program #include<stdio.h> void main(void); { char numbers[5][6]={"Zero","One","Two","Three","Four"}; printf("%s is %c",&numbers[4][0],numbers[0][0]); }
Find the output for the following C program int bags[5]={20,5,20,3,20}; void main(void) { int pos=5,*next(); *next()=pos; printf("%d %d %d",pos,*next(),bags[0]); } int *next() { int i; for(i=0;i<5;i++)
if (bags[i]==20) return(bags+i); printf("Error!"); exit(0);
}
Find the output for the following C program #include<stdio.h> void main(void) { int y,z; int x=y=z=10; int f=x; float ans=0.0; f *=x*y; ans=x/3.0+y/3; printf("%d %.2f",f,ans); }
Find the output for the following C program #include<stdio.h> void main(void); { double dbl=20.4530,d=4.5710,dblvar3; double dbln(void); dblvar3=dbln(); printf("%.2f\t%.2f\t%.2f\n",dbl,d,dblvar3); } double dbln(void) { double dblvar3; dbl=dblvar3=4.5; return(dbl+d+dblvar3); }
Find the output for the following C program #include<stdio.h>
static int i=5; void main(void) { int sum=0; do { sum+=(1/i); }while(0<i--);
}
Find the output for the following C program #include<stdio.h> void main(void) { int oldvar=25,newvar=-25; int swap(int,int); swap(oldvar,newvar);
printf("Numbers are %d\t%d",newvar,oldvar); }
int swap(int oldval,int newval) {
int tempval=oldval; oldval=newval; newval=tempval; }
Find the output for the following C program #include<stdio.h> void main(void); { int i=100,j=20; i++=j; i*=j; printf("%d\t%d\n",i,j); }
Find the output for the following C program #include<stdio.h> void main(void); int newval(int); void main(void) { int ia[]={12,24,45,0}; int i; int sum=0; for(i=0;ia[i];i++) { sum+=newval(ia[i]); } printf("Sum= %d",sum); }
int newval(int x) {
static int div=1; return(x/div++); }
Find the output for the following C program #include<stdio.h> void main(void); { int var1,var2,var3,minmax; var1=5; var2=5; var3=6; minmax=(var1>var2)?(var1>var3)?var1:var3:(var2>var3)?var2:var3; printf("%d\n",minmax);
Find the output for the following C program #include<stdio.h>
void main(void); {
void pa(int *a,int n); int arr[5]={5,4,3,2,1}; pa(arr,5);
}
void pa(int *a,int n) {
int i;
for(i=0;i<n;i++)
printf("%d\n",*(a++)+i); }
Find the output for the following C program #include<stdio.h> void main(void); void print(void); { print(); } void f1(void) { printf("\nf1():"); }
Find the output for the following C program #include "6.c"
void print(void) {
extern void f1(void); f1();
}
static void f1(void) {
printf("\n static f1()."); }
Find the output for the following C program #include<stdio.h>
void main(void); static int i=50; int print(int i); void main(void) {
static int i=100; while(print(i)) { printf("%d\n",i); i--; } } int print(int x) {
static int i=2; return(i--); }
Find the output for the following C program #include<stdio.h>
void main(void); typedef struct Ntype { int i; char c; long x; } NewType; void main(void)
{ NewType *c; c=(NewType *)malloc(sizeof(NewType)); c->i=100; c->c='C'; (*c).x=100L; printf("(%d,%c,%4Ld)",c->i,c->c,c->x); }
Find the output for the following C program #include<stdio.h> void main(void); const int k=100; void main(void) { int a[100]; int sum=0; for(k=0;k<100;k++) *(a+k)=k; sum+=a[--k]; printf("%d",sum); }
Enter Your Comments ////////// DSQ PAPER
Techanical paper
Questions 1 -5 are reference to the followig psedo code {
input m,n,z
TEST:if ((m+n)/3>5)z=z+1 else z =z-1 printf m,n,z
{
(m-m+1;n=n-3)
if (m+n+2)>14 then goto test print m,n,z
end }
1. what is the final output of the if the input is 2,14,12 (m,n,z) a)1,8,4 b)1,4,8 c)4,8,1 d)8,4,2
2. what is the final output if the input is 1,18,2? (m,n,z) ans) 5,6,2 i.e ans =c.
3. How many times is TEST execute ed if the input is 2,14,1? ans) twice ans=c.
4) How many times the TEST exected if the input is 1,18,2? ans)four times
5) what are the values taken by Z when input being 8,24,1? a)only 5 b)only 6 c)neither 5 or 6 d)both 5 and 6
ans)D.
6) the function f(x) is defined as follows if x=0 then f(x) =1
if x>0 then if ((x>10)then f(x) =x-10 else f(x) =x+1))
if x<0 then if (x**2 <100) then f(x) =f(-x+1) else f(x) =f(-(x+1)) 6) the above of f(2) +f(-3) is ans=8. 7) the value of f(8)+f(9) is ans=20 8) the value of f(1)+f(2)+f(3)...+f(10) is ans=65 9) the value of f(-10)+f(-9)+f(-8) is a) 33 b)25 c)-27 d)27 11. 1997 haeadecimal is a)7cb b)7cd c)7cf d)7ca ans-c
12. the remainder when 9FA (hexa) is divided by 8 is added to the 12(to base ten) to get x.then x has the binary opertion
ans=1110
13. the remainder when 1221 (in hexa) is diveded by 17(decimal) in (hexa)is ans=0
14. The binary number 100010011 will the hexa representation ans=113
15. The binary number 10011001 will the octal representation ans=463
16 Find the odd man out
16 a) Intel b)motorola c)nec d)Ibm ans =nec
17. a)BIt b)byte c)nibble d)field ans= field
18 a)Tree b)Root c)Log d)leaf ans=log
19. a)ROM b)PROM c)EPROM d)EEPROM ans=ROM
20. a)MOVE b)DEL c)COPY d)REN ans=DEL
21. What's the output of the following program main()
{ int z=3;
printf("%d %d ",z,main()); }
a)prints a value 3 b)prints junk value c)error message d)infinite loop 22) main() { int i=3,j=5; while (i--,J--) { printf("%d %d".i,j); } }
The loop will be executed
a)3 times b)5times c)8times d)infinite times 23) main() { int i=3,j=5 If(i--,j--) printf("%d %d ",i,j); }
The output of the program for (i,J)is a)3,5 b)3,4 c)2,4 d)2,5
ans=B 24) main() {
int i=3
printf ("%d %d %d ",++i,i-,i+=5); }
The the out put of the program is a)8,8,8 b)4,3,8 c)3,2,7 d)4,4,9
ans=B 25) main() { int times =5; int i=3; int j=4; int k=34; i=j+k; while(times --) { i=times j=times k=times }
printf("%d %d %d " ,i,j,k) }
THe output of the praogram is (i,j,k)
a)19,9,35 b)38,42,80 c)43,47,85 d)15,14,41 ans=C 26) main() { int num =32765; while (num++); printf(" %d ",num) }
what"s the out put ofthe program
a)prints all the number above 32765 including the number 32765 b)prints all the number above 32765 excluding the number 32765 ans=B. 27) main() { float k=3.4156 printf("%f %f ",float(k),c(k)) }
The output of the program
a) 3.4156 ,3.4156 b)4,5 c)3,4 d)3.45 3.40 ans=C.
28) main() {
int bounce =4;
printf ("total number of bounce =%d",bounce ++); }
ans=D (stoP) 29) main() {
int number =25; char name ='A'
printf("The addition of the name and the number is %o "name +_number) }
the output of the program is a)compiler error
b)run time error ans= A
30)
31) ODBC means
ans= open data base connectivity 32) ASCII stands for
ans= american standard for information interchange 33)
34) flops stands for
ans)floating point operation per second 35) by superconductivity
ans)
36) PERT stands for
Program evalution and review techniq 37) IMS is a
ans) data base system 38) HTML is a
ans) Hyper text markup language
39) The default backend of visual basic is ans)sybase
40) Client server is based on ans) distribution processing
44) computer viruses can spread from one system to anther by means of a) infected disks b)links to a network
c)downloaded program from a bulletin boardd)all of the program ans)D
45) A front end processor is usually used in ans=multi processing.
46) A radio active material of mass 16gms loses in 10 years due to radiation.How many more years will take for the material to attain a mass of of 1gm ?
ans=80 years
47) A block of ice floats on water in a beaker as the melts the water level n the beaker will remain the same
ans=Remains same.
48) if va,vn,vs are velocities of sound in a air ,water ,and steel then ans)vs>vn>va
49) in usual computer arthimetic the value of the integer expression 22/5*2+8*2/6
ans= 8.
50) an operting system is a
a)file manager b)memory manager c)i/o manager d)all of the above ans=D.
1.How many liters of water must be added to 30 liters of alcohol to make a solution thatis 25%
ans:120
2.How much is 3/7 larger than 20 percent of 2 ans;1/35
3.xyz=120,then which of the following cannot be a value of y ans:0
4.a number of subsets of a set s is 128, then s has ans:7
5. xsqrt(0.09)=3 , then x equals ans:
6.perimeter of rectangle is s and the other sideis x, then the other side ans:(s-2x)/2
7.solution of system of equations y-z=0,x+8y=4,3x+4y=7z is ans:x=1,y=1,z=1
15. f(x,y) =x**2 -y**2 then the value of f(4,(f(1,2) is ans =7.
16. if the radius of the circle is incresed by 6% then its area incresed by
ans=36%
17. the average of seven numbers is 2.5 then their product asn=17.5
18. the minimum of (2x+1)**2 + (x+2) is at x = ans = (-4/5)
19. the probability of getting at least in a single through of three coins is
20. atrain covers the distance D beteween two cities in hhours arriving 2 hours late.what rate would permit to train to arrive on schdule? ans= (D/H-2)
21. in a single throw of dice ,the chance of throwing a total of 3 is ans) 1/216.
22. a triangle of sides 3,4,5 then its----is ans:6
23. Which of the following is next smaller invalue than--- one half ans:2/5
24. if f(x)=1/x then f(f(f(x))) equals ans:1/x
25. if f(x)=1/x**2 , then f(f(f(x))) ans:1/x
26.if 8x+4y=6 and 4x+5y=7, x+y equl\als ans:1
27. find the next number in the series 1,2,5,10,17,26 ans:37
28,.sqrt(0.16)+cubic root(0.027) equals ans:0.7
29.if a,b>0 and a+b=2 then the max value of ab is ans:1
30. p and q are positiveintegers with their average 5, find how many different values can p take
ans:9
31. if 0<x<1 which of the following is the largest ans:1/x
33. If x,y,z are three consecutive natural numbers, which of the following numbers should be x+y+z
ans:2/3
34. two persons run a race of 100m. the winner won by (110/11)m and one second in time. find the speed of lsoer in met
ans:9.09
35. in a group of 15,7 can speak spanish, 8 can speak french and 3 can speak neither,. how much of the group can speak both french and spanish ans:1/5
36. which of the following intefgers is the square of an integer for every integer ans:a**2+2n+1
37. which of the following has the largest numberical value ans:0.2/0.000001
38. ifn is odd which of the following statements is true ans: 3n+1 is even
39. which of the following is the prime ans:80
Optimize the below 1,2,3,4 questions for time: 1)
int i;
if i=0 then i:=1; if i=1 then i:=0; 2)
int i;
if i=0 then i:=1; if i=1 then i:=0;
(given that i can take only two values (1,0)) 3)
int i;
if i=0 then i:=1; else if i=1 then i:=0;
(given that i can take only two values (1,0)) 4)
int m,j,i,n; for i:=1 to n do m:=m+j*n
5) Expand the following a) ISDN
b) CASE c) CSMA/CD d) OOPS e) MIMD
6) In the following questions, answer A,B,C,D depending on when the errors are detected?
A if no error is detected
B if semantic and syntactic checking
C if during Code genration & Symbol allocation D run time
a) Array overbound b) Undeclared identifier c) stack underflow
d) Accessing an illegal memory location
page replacement algorithm is used ( The memory can only have 3pages): 1,2,3,4,2,1,5,2,4 (something like that)
Enter Your Comments //////// Mistral Solutions
C Section
1. What does the following program print? #include <stio.h> int sum,count; void main(void) {< BR> for(count=5;sum+=--count;) printf("%d",sum); }
a. The pgm goes to an infinite loop b. Prints 4791010974 c. Prints 4791001974 d. Prints 5802112085 e. Not sure
2. What is the output of the following program? #include <stdio.h>
void main(void) {
int i;< BR> for(i=2;i<=7;i++) printf("%5d",fno()); } fno() { staticintf1=1,f2=1,f3; return(f3=f1+f2,f1=f2,f2=f3); }
a. produce syntax errors b. 2 3 5 8 13 21 will be displayed c. 2 2 2 2 2 2 will be displayed d. none of the above e. Not sure
3. What is the output of the following program? #include <stdio.h>
void main (void) { int x = 0x1234; int y = 0x5678; x = x & 0x5678; y = y | 0x1234; x = x^y; printf("%x\t",x);
x = x | 0x5678; y = y & 0x1234; y = y^x; printf("%x\t",y); } a. bbb3 bbb7 b. bbb7 bbb3 c. 444c 4448 d. 4448 444c e. Not sure
4. What does the following program print? #include <stdio.h>
void main (void) { int x; x = 0; if (x=0) printf ("Value of x is 0"); else
printf ("Value of x is not 0"); }
a. print value of x is 0 b. print value of x is not 0 c. does not print anything on the screen d. there is a syntax error in the if statement e. Not sure
5. What is the output of the following program? #include <stdio.h>
#include <string.h> int foo(char *); void main (void) {
char arr[100] = {"Welcome to Mistral"}; foo (arr); } foo (char *x) { printf ("%d\t",strlen (x)); printf ("%d\t",sizeof(x)); return0; } a. 100 100 b. 18 100 c. 18 18 d. 18 2 e. Not sure 6. What is the output of the following program? #include <stdio.h>
display() {
printf ("\n Hello World"); return 0;
void main (void) { int (* func_ptr) (); func_ptr = display; printf ("\n %u",func_ptr); (* func_ptr) (); }
a. it prints the address of the function display and prints Hello World on the screen b. it prints Hello World two times on the screen
c. it prints only the address of the fuction display on the screen d. there is an error in the program e. Not sure
7. What is the output of the following program? #include <stdio.h>
void main (void) { int i = 0; char ch = 'A'; do putchar (ch); while(i++ < 5 || ++ch <= 'F'); }
a. ABCDEF will be displayed b. AAAAAABCDEF will displayed c. character 'A' will be displayed infinitely d. none e. Not sure 8. What is the output of the following program?
#include <stdio.h>
#define sum (a,b,c) a+b+c #define avg (a,b,c) sum(a,b,c)/3 #define geq (a,b,c) avg(a,b,c) >= 60 #define lee (a,b,c) avg(a,b,c) <= 60
#define des (a,b,c,d) (d==1?geq(a,b,c):lee(a,b,c)) void main (void)
{
int num = 70; char ch = '0'; float f = 2.0;
if des(num,ch,f,0) puts ("lee.."); else puts("geq...");
}
a. syntax error b. geq... will be displayed c. lee.. will be displayed d. none e. Not sure
9. Which of the following statement is correct?
a. sizeof('*') is equal to sizeof(int) b. sizeof('*') is equal to sizeof(char) c. sizeof('*') is equal to sizeof(double) d. none e. Not sure
10. What does the following program print? #include <stdio.h>
char *rev(int val); void main(void) {
extern char dec[]; printf ("%c", *rev); }
char *rev (int val) {
char dec[]="abcde"; return dec;
}
a. prints abcde b. prints the address of the array dec
c. prints garbage, address of the local variable should not returned d. print a e. Not sure 11. What does the following program print?
void main(void) { int i; static int k; if(k=='0') printf("one"); else if(k== 48) printf("two"); else printf("three"); }
a. prints one b. prints two c. prints three d. prints one three e. Not sure
12. What does the following program print? #include<stdio.h>
void main(void) {
enum sub {
chemistry, maths, physics }; struct result { char name[30]; enum sub sc; };
strcpy (my_res.name,"Patrick"); my_res.sc=physics;
printf("name: %s\n",my_res.name); printf("pass in subject: %d\n",my_res.sc); }
a. name: Patrick b. name: Patrick c. name: Patrick pass in subject: 2 pass in subject:3 pass in subject:0 d. gives compilation errors e. Not sure
13. What does
printf("%s",_FILE_); and printf("%d",_LINE_); do?
a. the first printf prints the name of the file and the second printf prints the line no: of the second printf in the file
b. _FILE_ and _LINE_ are not valid parameters to printf function
c. linker errors will be generated d. compiler errors will be generated e. Not sure 14. What is the output of the following program?
#include <stdio.h>
void swap (int x, int y, int t) {
t = x; x = y; y = t;
printf ("x inside swap: %d\t y inside swap : %d\n",x,y); } void main(void) { int x; int y; int t; x = 99; y = 100; swap (x,y,t);
printf ("x inside main:%d\t y inside main: %d",x,y); }
a. x inside swap : 100 y inside swap : 99 x inside main : 100 y inside main : 99 b. x inside swap : 100 y inside swap : 99 x inside main : 99 y inside main : 100 c. x inside swap : 99 y inside swap : 100 x inside main : 99 y inside main : 100 d. x inside swap : 99 y inside swap : 100 x inside main : 100 y inside main : 99 e. Not sure
15. Consider the following statements:
i) " while loop " is top tested loop ii) " for loop " is bottom tested loop
iii) " do - while loop" is top tested loop iv) " while loop" and "do - while loop " are top tested loops.
a. i only b. i & ii c. iii & i d. ii, iii & iv e. Not sure 16. Consider the following piece of code:
char *p = "MISTRAL"; printf ("%c\t", *(++p)); p -=1;
printf ("%c\t", *(p++));
Now, what does the two printf's display? a. M M b. M I c. I M d. M S e. Not sure
17. What does the following program print? #include <stdio.h> struct my_struct { int p:1; int q:1; int r:6; int s:2; };
struct my_struct bigstruct; struct my_struct1
{
char m:1; };
struct my_struct1 small struct; void main (void)
{
printf ("%d %d\n",sizeof (bigstruct),sizeof (smallstruct)); }
a. 10 1 b. 2 2 c. 2 1 d. 1 1 e. Not sure 18. Consider the following piece of code: FILE *fp;
fp = fopen("myfile.dat","r"); Now fp points to
a. the first character in the file.
b. a structure which contains a char pointer which points to the first character in the file. c. the name of the file. d. none of the above. e. Not sure.
19. What does the following program print? #include <stdio.h>
#define SQR (x) (x*x) void main(void)
{
a = SQR (b+2); }
a. 25 b. 11 c. 17 d. 21 e. Not sure. 20. What does the declaration do? int (*mist) (void *, void *);
a. declares mist as a function that takes two void * arguments and returns a pointer to an int.
b. declares mist as a pointer to a function that has two void * arguments and returns an int.
c. declares mist as a function that takes two void * arguments and returns an int. d. there is a syntax error in the declaration. e. Not sure.
21. What does the following program print? #include <stdio.h>
void main (void) {
int mat [5][5],i,j; int *p;
p = & mat [0][0]; for (i=0;i<5;i++) for (j=0;j<5;j++) mat[i][j] = i+j;
printf ("%d\t", sizeof(mat)); < BR> i=4;j=5; printf( "%d", *(p+i+j));
}
a. 25 9 b. 25 5 c. 50 9 d. 50 5 e. Not sure
22. What is the output of the following program? #include <stdio.h>
void main (void) { short x = 0x3333; short y = 0x4321; long z = x; z = z << 16; z = z | y; printf("%1x\t",z); z = y; z = z >> 16; z = z | x; printf("%1x\t",z); z = x; y = x && y; z = y;
printf("%1x\t",z); }
a. 43213333 3333 1 b. 33334321 4321 4321 c. 33334321 3333 1 d. 43213333 4321 4321 e. Not sure
23. What is the output of the following program? #include <stdio.h>
void main (void) { char *p = "Bangalore"; #if 0 printf ("%s", p); #endif }
a. syntax error #if cannot be used inside main function b. prints Bangalore on the screen c. does not print anything on the screen
d. program gives an error "undefined symbol if" e. Not sure
24. If x is declared as an integer, y is declared as float, consider the following expression: y = *(float *)&x;
Which one of the following statments is true?
a. the program containing the expression produces compilation errors; b. the program containing the expression produces runtime errors;
c. the program containing the expression compiles and runs without any errors; d. none of the above e. Not sure
25. What is the return type of calloc function? a. int * b. void * c. no return type: return type is void d. int e. Not sure
Enter Your Comments /////////// MOTOROLA PSGTECH 2003
There were basically 3 papers -software ,DSP, Semiconductor software paper (20 questions 45 minutes) concentrate more on data structures 10 questions from data structures and 10 from C++ and data structures10 questions were in the fill in the blank format and 10 questions were multiple choice questions.
bubble sorting is
a)two stage sorting b)...
c)....
.c++ supports a) pass by value only b) pass by name c) pass by pointer
d) pass by value and by reference
.Selection sort for a sequence of N elements no of comparisons = _________ no of exchanges = ____________ Insertion sort no of comparisons = _________ no of exchanges = ____________ what is a language? a) set of alphabets
b)set of strings formed from alphabets c)...
d)none of the above Which is true abt heap sort a)two method sort
b)has complexity of O(N2) c)complexity of O(N3) d)...
In binary tree which of the following is true a)binary tree with even nodes is balanced
b)every binary tree has a balance tree c)every binary tree cant be balanced
d)binary tree with odd no of nodes can always be balanced
Which of the following is not conducive for linked list implementation of array a)binary search b)sequential search c)selection sort d)bubble sort In c++ ,casting in C is upgraded as a)dynamic_cast b)static_cast c)const_cast d)reintrepret_cast
a)it is an undirected graph with vertex representing activities and edges representing precedence relations
b)it is an directed graph "" "" """ "" "" "" "" "" " c)...
d)...
Question on worst and best case of sequential search question on breadth first search
char *p="abcdefghijklmno" then printf("%s",5[p]); what is the error struct { int item; int x;} main(){ int y=4; return y;} error:absence of semicolon
Which of the following is false regarding protected members a)can be accessed by friend functions of the child
b) can be accessed by friends of child's child c)usually unacccessible by friends of class
d) child has the ability to convert child ptr to base ptr What is the output of the following
void main() { int a=5,b=10; int &ref1=a,&ref2=b; ref1=ref2; ++ ref1; ++ ref2; cout<<a<<b<<endl; } value of a and b a)5 and 12 b)7 and 10 c)11 and 11
d)none of the above What does this return f(int n)
{
return n<1?0:n==1?1:f(n-1)+f(n-2) }
code for finding out whether a string is a palindrome,reversal of linked list, recursive computation of factorial with
blanks in the case of some variables.we have to fill it out for eg; for palindrome
palindrome(char * inputstring) {
int len=strlen ( ?); int start= ?;
end =inputstring + ?-?;
for(; ?<end && ?==?;++ ?,--?); return(?==?); }
we have to replace the question marks(?) with corresponding variables .linked list reversal
Linked (Link *h) { Link *temp,*r=0,*y=h; while(y!= ?) (ans:Null) { temp = ?;(ans:y->next)
some code here with similar fill in type }
fill in the blanks type question involving recursive factorial computation
Enter Your Comments
Novell Recruitment test conducted on (20/9/04). There is four section in test. Aptitude 20 questions 20 minutes
System comcept 20 questions 15 minutes C programming 15 questions 20 minutes Passage on java/internet 10 min
Aptitude
A problem on time and work ,A and b takes 15 days to completer the work,A takes 30 days so how many days B take?
A question on compound interest with 5 sub questions,simple if u know the concept. A question on finding the speed of boat given the speed of upstream and downstream. System Concept ( mainly questions from OS,data structures,networks)
Berkeley sockets-ans :connection oreiented. A question on bankers algorithm
Complexity of hastable What is Cpu timeslice? Aquestion on DMA C programming
One pointer diff is given like this: int *(*p[10])(char *)
Explain the variable assignment For the following C program void fn(int *a, int *b)
{ int *t; t=a; a=b; b=t; } main() { int a=2; int b=3; fn(&a,&b); printf("%d,%d", a,b); }
What is the output? a) Error at runtime b) Compilation error c) 2 3 d) 3 2 main() { printf("hello"): main();
}
what is the output? ans :stack overflow
Enter Your Comments
Each question had 5 options.There were 25 question in all and all were Objective Type. 1 When compiled from command line what are linking options?
2 You have written a code in C++, and u have to use a C library , what would u do? (Ans: write extern "c" in header files)
3 Fiber optic backbone is in which OSI layer? 4 void main() { int x=1; int y=1; int i; for(i=2;i<=100;i++) { x=x+i;y=y*(i+1)/(i-1); }
What are the values of x & y?
5 If we carry out operation (-3)+(-6),then which of the what will be the value of carry and sign flag?
6 void abc(int a[]) { int k=0;int j=50; while(k<j) { if(a[i]>a[j]) k++; else j--; }
How many times the loop will occur?
7 Integrate e^(x^-2)dx , with limits -infinity to +infinity?What is the final value? 8 Let p be a 16 bit number.The 2's complement of p will be represented by? 9 void main()
{
int x,y; int *p=&a[2]; *p++; x=++*p; y=*(p++); printf("%d %d",x,y)' }
What will be the value of x and y?
10 Let there be a set of 3 numbers.Then number of groups possible? 11 A question on some technique used in DA-converter?
12 Which data structure to use for fastest search?
13 A binary tree contains 1024 elements.What is maximum number of comparisons needed to search an
element?
14 s=1-1/4+1/16-1/32... What is the value of S?(Ans = 0.8 Hint Its a GP)
15 A C++ class has multiple references to base class.Then some options were given? 16 for(i=0;i<20;i++) { a[i]=i; } for(i=0;i<20;i++) { a[i]=a[19-i]; }
What is final value of array a? Options were there. 17 In Java can a variable be initilised inside a loop?
18 Two dices are thrown.What is the probality that the the number on the first dice is greater or equal to
number on the second dice?
Enter Your Comments RAMCO SYSTEMS
1. How many butes does an array A(1:8,-2:2,1:5) require for storage if each element of the array is 24 bits long.
2. begin i:=0; j:=0; | block d loop: if(i != 0) i := i-1; else i := i+1; i := i+1; | block a j := j+1; | block b if (j <= 25) goto loop; end | block c
a) What is the value of i at [c] 2 ?
b) How many times is the goto executed 25 ?
c) How many times is the loop executed if i is initialized to 1 in [d] 26
d) How many times is the loop entered if the block [b] is changed to j=j+1 ?
e) What is the value of i at [c] interchanging blocks [a] and [b] ? 2 ?
Follow the instructions given below [ From 1 to 8 ] 1. A cause B or C but not both
2. F occurs only if B occurs 3. D occurs if B or C occurs 4. E occurs if only c occurs 5. J occurs only if E or F occurs 6. H occurs if E occurs
7. D causes G, H or Both. 8. G occurs if F occurs. Questions
---1. If A occurs which of the following may occur 1. F & G (ii) E & H (iii) D
Ans
(a) 1 only (b) 2 only (c) 3 only (d) 1,2,3 or 2 & 3 but not 1 (e) 1,2 & 3
2. If B occurs which must occur Ans
(a) F & G (b) D & G (c) D (d) G & H (e) J 3. If J occurs which must occur
(a) E (b) Both E & F (c) Either B or C (d) B (e) Both B & c 4. Which may occur as a result by a cause not mentioned. (I) D (II) A (III) F
Ans
(a) I only (b) II (c) I & II (d) II & III (e) I,II,III 5. If E occurs which cannot occur.
(a) F (b) A (c) D (d) C (e) J
1) A - G are 7 consecutive +ve integers not necessarily in the same order 1) B is the middle number
2) D is 3 less than c
3) the difference between F & A is equal in magnitude and sign to the difference between E & C
4) Neither F nor C lie between E & G a) What is the value of B-F
1 2 -1 -2 cannot be determined b) which is greatest
F C A E cannot be determined
c) Given both A & B are primes what is the lowest value of E 8 6 9 12 cannot
2) Given that a,b,c,d,e each represent one of the digits between 1-9 and that the following multiplication holds
a b c d e 4
---e d c b a
1) Find the output for the following C program main() { char *p1="Name"; char *p2; p2=(char *)malloc(20); while(*p2++=*p1++); printf("%s\n",p2); }
Ans. An empty string
2) Find the output for the following C program main()
{
int x=20,y=35; x = y++ + x++; y = ++y + ++x;
printf("%d %d\n",x,y); }
Ans. 57 94
3) Find the output for the following C program main() { int x=5; printf("%d %d %d\n",x,x<<2,x>>2); } Ans. 5 20 1
4) Find the output for the following C program #define swap1(a,b) a=a+b;b=a-b;a=a-b;
main() { int x=5,y=10; swap1(x,y); printf("%d %d\n",x,y); swap2(x,y); printf("%d %d\n",x,y); }
int swap2(int a,int b) { int temp; temp=a; b=a; a=temp; return; } Ans. 10 5
5) Find the output for the following C program main()
{
char *ptr = "Ramco Systems"; (*ptr)++;
printf("%s\n",ptr); ptr++;
printf("%s\n",ptr); }
Ans. Samco Systems
6) Find the output for the following C program #include<stdio.h>
{ char s1[]="Ramco"; char s2[]="Systems"; s1=s2; printf("%s",s1); }
Ans. Compilation error giving it cannot be an modifiable 'lvalue' 7) Find the output for the following C program
#include<stdio.h> main() { char *p1; char *p2; p1=(char *) malloc(25); p2=(char *) malloc(25); strcpy(p1,"Ramco"); strcpy(p2,"Systems"); strcat(p1,p2); printf("%s",p1); }Ans. RamcoSystems
8) Find the output for the following C program given that [1]. The following variable is available in file1.c
static int average_float;
Ans. All the functions in the file1.c can access the variable 9) Find the output for the following C program
# define TRUE 0 some code while(TRUE) { some code }
Ans. This won't go into the loop as TRUE is defined as 0 10) Find the output for the following C program
main() { int x=10; x++; change_value(x); x++; Modify_value(); printf("First output: %d\n",x); } x++; change_value(x); printf("Second Output : %d\n",x); Modify_value(x);
printf("Third Output : %d\n",x); } Modify_value() { return (x+=10); } change_value() { return(x+=1); } Ans. 12 1 1
Enter Your Comments Sample Test Paper Technical Questions main() { char **p=="Hello"; printf("%s",**p); }
Ans: Garbage or nothing main()
{
printf("%d%c\n"); printf("%d%c\n"); }
Ans: Garbage Value main() { int x==5; printf("%d%d",x++,++x); } Ans==6 6 main() { int x==4; printf("%d",printf(" %d %d ",x,x) ); } Ans: 4 4 5 main()
{ union { int i; char p; struct { int t; char e; char o; }w; }; printf("%d\n",sizeof(l) ); } Ans: 4 main() { int i==0,n==6; while(n--0); i+==n; printf("%d\n",i); } Ans: -1 ain() { char a[]=="Hello"; printf("%c\n",*a++); } Ans: Error a=3,b=2,c=1;
What's the value of k? k== a< b < c-1; Ans: 0 main() { int a=3; do { printf("%d", a); a=-1; } while(a0); }
Ans: 3
It is not "exact" Question; But the given Answers is: a) PASS1 PASS2 b) PASS1 FAIL1 c)FAIL1 FAIL2 d)FAIL1 PASS2 main() { char c==-32; int i==-64; unsigned u==-26; if(ci) printf("PASS1"); if( i < c) printf("PASS2"); else printf("FAIL1"); if(i<U) printf("PASS2"); else printf("FAIL2"); }
Ans: PASS1 PASS2 PASS1 main()
{
int i==0;
for( i==0; i<= ;i++) { switch(i) { case 0: i+==5; case 1: i+==2; case 2: i+==5; default: i+==4; break; } printf("%d",i); } Ans: 16 21 main() { int i==4; switch(i)