Sonata Sample Technical Paper Sample Technical Paper 1. Point out error, if any, in the following program main() { int i=1; switch(i) { case 1: printf(\nRadioactive cats have 18 half-lives); break; case 1*2+4: printf(\nBottle for rent -inquire within); break; } } Ans. No error. Constant expression like 1*2+4 are acceptable in cases of a switch. 2. Point out the error, if any, in the following program main() { int a=10,b; a>= 5 ? b=100 : b=200; printf(\n%d,b); } Ans. lvalue required in function main(). The second assignment should be written in parenthesis as follows: a>= 5 ? b=100 : (b=200); 3. In the following code, in which order the functions would be called? a= f1(23,14)*f2(12/4)+f3(); a) f1, f2, f3 b) f3, f2, f1 c) The order may vary from compiler to compiler d) None of the above 4. What would be the output of the following program? main() { int i=4; switch(i) { default: printf(\n A mouse is an elephant built by the Japanese); case 1: printf( Breeding rabbits is a hair raising experience); break; case 2: printf(\n Friction is a drag); break; case 3: printf(\n If practice make perfect, then nobody's perfect); } } a) A mouse is an elephant built by the Japanese b) Breeding rabbits is a hare raising experience c) All of the above d) None of the above 5. What is the output of the following program? #define SQR(x) (x*x) main() { int a,b=3; a= SQR(b+2); printf(%d,a); } a) 25 b) 11 c) error d) garbage value 6. In which line of the following, an error would be reported? 1. #define CIRCUM(R) (3.14*R*R); 2. main() 3. { 4. float r=1.0,c; 5. c= CIRCUM(r); 6. printf(\n%f,c); 7. if(CIRCUM(r))==6.28) 8. printf(\nGobbledygook); 9. } a) line 1 b) line 5 c) line 6 d) line 7 7. What is the type of the variable b in the following declaration? #define FLOATPTR float* FLOATPTR a,b; a) float b) float pointer c) int d) int pointer 8. In the following code; #include main() { FILE *fp; fp= fopen(trial,r); } 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. 9. We should not read after a write to a file without an intervening call to fflush(), fseek() or rewind() < TRUE/FALSE> Ans. True 10. If the program (myprog) is run from the command line as myprog 1 2 3 , What would be the output? main(int argc, char *argv[]) { int i; for(i=0;i0) printf(%s,*++argv); } a) myprog monday tuesday wednesday thursday b) monday tuesday wednesday thursday c) myprog tuesday thursday d) None of the above 13. In the following code, is p2 an integer or an integer pointer? typedef int* ptr ptr p1,p2; Ans. Integer pointer 14. Point out the error in the following program main() { const int x; x=128; printf(%d,x); } Ans. x should have been initialized where it is declared. 15. What would be the output of the following program? main() { int y=128; const int x=y; printf(%d,x); } a) 128 b) Garbage value c) Error d) 0 16. What is the difference between the following declarations? const char *s; char const *s; Ans. No difference 17. What would be the output of the following program? main() { char near * near *ptr1; char near * far *ptr2; char near * huge *ptr3; printf(%d %d %d,sizeof(ptr1),sizeof(ptr2),sizeof(ptr3)); } a) 1 1 1 b) 1 2 4 c) 2 4 4 d) 4 4 4 18. If the following program (myprog) is run from the command line as myprog friday tuesday sunday, What would be the output? main(int argc, char*argv[]) { printf(%c,**++argv); } a) m b) f c) myprog d) friday 19. If the following program (myprog) is run from the command line as myprog friday tuesday sunday, What would be the output? main(int argc, char *argv[]) { printf(%c,*++argv[1]); } a) r b) f c) m d) y 20. If the following program (myprog) is run from the command line as myprog friday tuesday sunday, What would be the output? main(int argc, char *argv[]) { while(sizeofargv) printf(%s,argv[--sizeofargv]); } a) myprog friday tuesday sunday b) myprog friday tuesday c) sunday tuesday friday myprog d) sunday tuesday friday 21. Point out the error in the following program main() { int a=10; void f(); a=f(); printf(\n%d,a); } void f() { printf(\nHi); } Ans. The program is trying to collect the value of a void function into an integer variable. 22. In the following program how would you print 50 using p? main() { int a[]={10, 20, 30, 40, 50}; char *p; p= (char*) a; } Ans. printf(\n%d,*((int*)p+4)); 23. Would the following program compile? main() { int a=10,*j; void *k; j=k=&a; j++; k++; printf(\n%u%u,j,k); } a) Yes b) No, the format is incorrect c) No, the arithmetic operation is not permitted on void pointers d) No, the arithmetic operation is not permitted on pointers 24. According to ANSI specifications which is the correct way of declaring main() when it receives command line arguments? a) main(int argc, char *argv[]) b) main(argc,argv) int argc; char *argv[]; c) main() {int argc; char *argv[]; } d) None of the above 25. What error would the following function give on compilation? f(int a, int b) { int a; a=20; return a; } a) missing parenthesis in the return statement b) The function should be declared as int f(int a, int b) c) redeclaration of a d) None of the above 26. Point out the error in the following program main() { const char *fun(); *fun()='A'; } const char *fun() { return Hello; } Ans. fun() returns to a const char pointer which cannot be modified 27. What would be the output of the following program? main() { const int x=5; int *ptrx; ptrx=&x; *ptrx=10; printf(%d,x); } a) 5 b) 10 c) Error d) Garbage value 28. A switch statement cannot include a) constants as arguments b) constant expression as arguments c) string as an argument d) None of the above 29. How long the following program will run? main() { printf(\nSonata Software); main(); } a) infinite loop b) until the stack overflows c) All of the above d) None of the above 30. On combining the following statements, you will get char*p; p=malloc(100); a) char *p= malloc(100) b) p= (char*)malloc(100) c) All of the above d) None of the above 31. What is the output of the following program? main() { int n=5; printf(\nn=%*d,n,n); } a) n=5 b) n=5 c) n= 5 d) error

Sonata Placement Paper 2.pdf

There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. Main menu.

72KB Sizes 6 Downloads 181 Views

Recommend Documents

MindTree Placement Paper - ITtestpapers.com
May 5, 2005 - 30 mins for aptitude and 15 mins for coding. I remeber few q's: ... The speed of the truck is 16km/hr slower than car. Find the .... category.html.

MindTree Placement Paper - ITtestpapers.com
May 5, 2005 - 30 mins for aptitude and 15 mins for coding. .... www.ittestpapers.com/articles/mindtree-paper---05-may-2005---bit-campus.html#ixzz0rb7jcuLR.

ADP Placement Paper 5.pdf
Page 1 of 1. Hi Friends,. I had attended 4 ADP on june 18th the pattern is as follows firstly the written test takes place in that u will be asking aptitude,. some c q's ...

Satyam Placement Paper 33.pdf
3.intel's first micropro...a.pentium b.pentiumproetc ... 9.diff between 8087,8086 (which is latest vers.) 10.some ... Displaying Satyam Placement Paper 33.pdf.

Mphasis Placement Paper 2.pdf
Page 1 of 1. 2009 Mphasis Placement Papers Interview Experience. MPHASIS PAPER ON 7th SEPTEMBER 2009. Hi, I'm K.K.Aravindhan doing my final year ...

Motorola Placement Paper 3.pdf
format and 10 questions were multiple choice questions. 1. ... then printf(%s,5[p]); ... code for finding out whether a string is a palindrome,reversal of linked list, ...

Sample Placement Paper of Aakash Institute.pdf
Sample Paper. Aakash ..... In a certain code, "Beautiful I peacock saw" is given .... (1) Mango. (2) Banana. (3) Apple. (4) Carrot. 87. Complete the series. ? (1). (2).

Flextronics Placement Paper 9.pdf
Sign in. Loading… Whoops! There was a problem loading more pages. Whoops! There was a problem previewing this document. Retrying... Download. Connect ...

Capgemini Placement Paper 3.pdf
Capgemini Placement Paper 3.pdf. Capgemini Placement Paper 3.pdf. Open. Extract. Open with. Sign In. Main menu. Displaying Capgemini Placement Paper ...

CTS Placement Paper 2.pdf
I told OS and COMPUTER NETWORKS. So asked me to explain types of scheduling.asked me few more from OS.†did not know the†answer. HR: tell me about ...

cts-placement paper 2010.pdf
Page 2 of 3. he hears of 'four-dimensional' things, he is seized by a feeling, which is very similar to the. thoughts awakened by the occult. And at the same time the statement that the world in which we. live is a four-dimensional space - time conti

Deloitte Placement Paper 3.pdf
They expect students to be strong in the Enterprise application and Technology integration field. QUESTION PATTERN AND A FEW QUESTIONS. The pattern was similar to CTS pattern as the HR's were former CTS employees. The booklet given here was PINK. 40

TCS Placement Paper 3.pdf
28) p and q are pointers to the same type of dataitems. Which of these are ... followed by funk characters. c) name = \ ... Page 1 of 1. TCS Placement Paper 3.pdf.

Satyam Placement Paper 3.pdf
the h.r and finally got the job.and i am the one of them.i would like to share my ... 12)a problem from data interpretation..it was on line graphs...very big..not easy ...

Mindtree Placement Paper 6.pdf
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. Main menu.

Flextronics Placement Paper 2.pdf
Ans. Divide and Conquer. 23. Program counter is incremented in. a. fetch (ans). b. decode. c. execute. 24. what does the following program do ? f(int n). {. int c;.

Satyam Placement Paper 27.pdf
... and Interviews of Satyam held on 13th and 14th of September in Bangalore. ... Now,they asked whats the best way for A to send mails to B.. ... *How does JAVA implement multiple inheritance?[extends classes & implements interfaces]. HR.

Honeywell Placement Paper 3.pdf
Most of the question were from SOFTWARE ENGINEERING, C programming, Data structures, Operating systems such as- -> SDLC (software development life cycle)-what r various models [waterfall, prototype, iterative enhancement, spiral], wht r. the steps un

Cisco Placement Paper 1.pdf
Page 1 of 1. Placement Paper of CISCO. CISCO. ††††† (October, 2004). 1. In order to find out stack fault of a three input nand gate how many necessary input vectors. are needed ? 2. What is parity generation ? 3. A nand gate becomes ___ gat

Wipro Placement Paper 11.pdf
2)a person is running at a speed of 18km/hr After one† min a bomb blasts .Sound travels at ... If(0==fork()). ††† I+=10; ... Displaying Wipro Placement Paper 11.pdf.

ICICI Placement Paper 6.pdf
If the cost of the car is Rs.60 and a profit of 10% over selling price is earned (Ans: Rs 66/-)16. 1/3 of girls , 1/2 of boys go. to canteen .What factor and total number of classmates go to canteen. Ans: Cannot be determined. 17. The price of a prod

Deloitte Placement Paper 1.pdf
Page 1. Whoops! There was a problem loading more pages. Deloitte Placement Paper 1.pdf. Deloitte Placement Paper 1.pdf. Open. Extract. Open with. Sign In.

eFunds Placement Paper 1.pdf
2) Some questions related 2 windows.... Ans) FAT ... a) clustered b) nonclustered c) unique but clustered or no clustered... etc. 5) Which is ... Technical interview (30 - 45 min) questions from C, C++, Area of interest & final sem project. if v stud

Keane Placement Paper 3.pdf
6) program to check whether the given no is armstrong. number or not? Page 3 of 7. Main menu. Displaying Keane Placement Paper 3.pdf. Page 1 of 7.