You are on page 1of 12

New: Civil Engineering Questions and Answers !

Arithmetic Aptitude Data Interpretation Logical Reasoning Verbal Reasoning Non Verbal Reasoning General Knowledge Sudoku Number puzzles Missing letters puzzles Logical puzzles Playing cards puzzles Clock puzzles C Programming C++ Programming C# Programming Java Programming Microbiology Biochemistry Biotechnology Biochemical Engineering Civil Engineering Mechanical Engineering Chemical Engineering Networking Database Questions Computer Science Basic Electronics Digital Electronics Electronic Devices Circuit Simulation Electrical Enigneering Engineering Mechanics Technical Drawing Placement Papers Group Disucssion HR Interview Technical Interview Body Language Aptitude Test Verbal Ability Test Verbal Reasoning Test Logical Reasoning Test C Programming Test Java Programming Test Data Interpretation Test General Knowledge Test Data Structures Operating Systems Networking DATABASE Database Basics SQL Server Basics SQL Server Advanced SQL Server 2008 JAVA Core Java Java Basics Advanced Java UNIX Unix File Management Unix Memory Management Unix Process Managemnt C Interview Questions The C Language Basics .NET Interview Questions .NET Framework ADO.NET ASP.NET Software Testing Aptitude ▼ Reasoning ▼ Verbal Ability GK Puzzles Programming ▼ Engineering Medical ▼ Interview Online Test

Companies

Placement Papers :: HCL

3i Infotech @ : Home > Placement Papers > HCL > View Paper AAI ABACUS HCL Placement Question Paper: Solved (C Language) Rated : +41 , -3 ABB Accel Frontline HCL Placement Question Paper: Solved (C Language) Accenture Instructions: Aditi 1. Please ignore any case-sensitive errors and un-included libraries. 2. You may use the back of this question paper for any rough work. Adobe ADP Agreeya Q1. Akamai main() Alcatel Lucent { Allfon int i; clrscr(); Alumnus printf("%d", &i)+1; Amazon scanf("%d", i)-1; Amdocs } AMI Andhra Bank a. Runtime error. b. Runtime error. Access violation. AppLabs Apps Associates c. Compile error. Illegal syntax d. None of the above Aricent Ashok Leyland Aspire Atos Origin

} =-=-=-=--=-=-===-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- a. 225 c. *pf = 100. None of the above Ans: b) illegal syntax for using return Q3. none of the above Ans: b) 225 . char *argv[]) { (main && argc) ? main(argc-1. 1024 Ans: c) 1020 Q5. 4 b. printf(" %d". } a. main() { int i = 0xff . Runtime error. -1 dont hav any effect on code Q2. Some Integer not 100 d.printf( ) prints address/garbage of i. 1020 d. i<<2). 512 c. Compile error. } a.Axes Bajaj Bank of Maharashtra BEL BEML BHEL BirlaSoft Blue Dart Blue Star BOB BPCL BPL Brakes BSNL C-DOT Cadence Calsoft Canara Bank Canarys Capgemini Caritor Caterpillar CDAC CGI Changepond Ciena Cisco Citicorp CMC Consagous Convergys CORDYS Crompton CSC CTS Cummins Dell Deloitte Delphi-TVS DeShaw Deutsche Dotcom DRDO EDS EIL ELGI ELICO ERICSSON Essar Fidelity Flextronics Freescale FXLabs GAIL GE Genpact Geodesic Geometric Globaledge GlobalLogic Godrej Google Grapecity HAL HCL Hexaware Ans: d. NULL) : return 0. b. scanf() dont hav & sign. main(int argc. b. 225/SQR(15)). Gets into Infinite loop d.00. None of the above Ans: d) 0 Q4. main() { int i. #define SQR(x) x * x =-=-=-=--=-=-===-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- main() { printf("%d". Illegal syntax c. Runtime error. } a. printf(" %d". i). 15 d. pf = (float *)&i. 100 c. 1 b. so scans address for i +1. float *pf.

a[4]. 100.) ={printf. Random number. int l. i). 4.st. 0 b. } a.i = 100.a)). } a. 4 c. }u. 100. 4. Random number. main() { int (*functable[2])(char *format. (*functable[0])("%d". =-=-=-=--=-=-===-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- main() { printf(" %d". b.i. u. union u { struct st { int i : 4. c. }u. &i). 4 b. (*functable[0])("%d".u. // printf("%d".st. Runtime error. u. 4. 4. 0. printf("%d. int i. Compile error d. main() { . main() { u. 0 d. (*functable[1])("%d". printf(" %d". union u { union u { int i. int b[10]. Random number Q9. %d. 4. 100.. 4. . 200. 100. 40 400 4 Ans: 20. 1 d. sizeof(u.l). 0 Ans: c) 100. i). 0 Q7. i). sizeof(u. 4. 0 c. Random number.Honeywell HP HPCL HSBC Huawei Hughes IBM IBS ICICI iGate Impetus iNautix Indian Airforce Indian Airlines Infosys Infotech Intec Integra Intergraph IOCL iSOFT ISRO Ittiam JSW Keane Kenexa L&T L & T Infotech LG Soft Lifetree LionBridge Mahindra Satyam Mastek Maveric McAfee MECON Microsoft MindTree Miraclesoft Mistral Motorola Mphasis MTNL NIC Nokia Siemens Novell NTPC Nucleus ORACLE Patni Perot Polaris Ramco Robert Bosch Samsung SAP Sapient Sasken SBI Sierra Atlantic Sonata Sony India Sutherland Syntel TCS Tech Mahindra Q6.i. } a. int j : 4. 100. 0. }st. (*functable[1])("%d". 1. scanf}. 40. int i = 100. int k : 4. sizeof(u)). 4. int j. }a[10]. error for 3rd printf Q8. 40.i)).. %d".

printf("\%) c. 3rd will be null pointer assignment Q11. &i. } a. scanf("%d %d"+scanf("%d %d". // i is divided by pointer p } a. printf("\%) b. j. } a.00000 Ans: c) Error becoz i/(*p) is 25/25 i. i = 25. I am O Ans: c) I am OK is not in " " Q13. 0.00000 c. Compile error d. main() { int i. i. j). VeriFone Virtusa Wipro Zensar main() { char *p = "hello world". How will you print % character? a. printf("\%%) . Compile error d. j = 100. printf("%%) d. Runtime error. i/(*p) ).e 1 which is int & printed as a float. char * strB = I am OK. Runtime error. Compile error d. 0 c. Runtime error. j. 1. b. p = &i. strB. } a. memcpy( strA. main() { char * strA. I am OK c. p[0] = 'H'. Compile error d. b. "hello world Ans: b) Hello world Q12. So abnormal program termination. printf("%s". 0.int i. "Hello world c. the first two values entered by the user Ans: d) two values entered. &j)). Runtime error. b. *p. // Address of i is assigned to pointer p printf("%f". 6). printf("%d %d". p). b. runs if (float) i/(*p) -----> Type Casting Q10.

4 d. Your Address. clrscr(). obj->pAddress = malloc(100). Your Name Your Name d. strcpy(obj->pName. compile error c. 2 c. Name d. main() { struct Foo *obj = malloc(sizeof(struct Foo)). printf("%s". obj->pName = malloc(100).perplexed). Your Name b. obj->pName). } a.Ans: c) printf(" %% "). strcpy(obj->pName. clrscr(). printf("%s". struct Foo { char *pName. 0 b. obj->pName). #define perplexed 3 main() { #ifdef perplexed #undef perplexed #define perplexed 4 #endif printf("%d". Q14. }."Your Name"). char *pAddress. strcpy(obj->pAddress. printf("%s". obj->pAddress). } a. } a."Your Name"). Your Address b. Your Address c. None of the above . free(obj). main() { struct Foo *obj = malloc(sizeof(struct Foo)). }. "Your Address"). none of the above Ans: c) Q15. const int perplexed = 2. struct Foo { char *pName. Runtime error Ans a) Q16. Your Name.

clrscr(). Hello b. main() { char *a = "Hello ".b)). } main() { int a[10][10]. main() { char *a = "Hello ". strcat(a. Ok it worksWill this work? d.b)). overwrites Hello in a. as after free(obj). copies World on a. printf("%s". char *b = "World". "Hello b. } a. None of the above Ans: d) World. None of the above Ans: b) Q18. "HelloWorld d. Hello World c. HelloWorld d. } a. Will this work? c. =-=-=-=--=-=-===-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- . clrscr(). func1(a). } void func2(int a[][10]) { printf("Will this work?"). void func1(int (*a)[10]) { printf("Ok it works"). no memory is there containing obj->pName & pbj->pAddress Q17. Ok it works b. func2(a). strcpy(a.Ans: d) printd Nothing. char *b = "World". Q19. "Hello World c. None of the above Ans: c) Q20. printf("%s". } a.

printf("%d". sizeof(sizeof(i))). 2. } a. main() { int c = 5. -456 c.main() { printf("%d. 2 Q21. sizeof('c'). . clrscr(). sizeof(100)). main() { int i = 100. c). 1 b. int i = 456. c = i. clrscr(). none of the above Ans: a) 2 Q22. } a. } a. 0 d. main() { char c. illegal use of pointer Q23. } a. void main () { int x = 10. none of the above Ans: d) -56 Q24. 2 b. 100 c. 4. 4 d. main||c). 5 c. printf("%d". 4. 100 d. if we use main|c then error. %d". 100 c. 2 b. 456 b. 2. random number d. none of the above Ans: a) 1. 4 Ans: a) 2. printf("%d".

main() { int x=5. 9 c. 5 c.x--) { printf("x=%d ". as condition x==0 is False Q27 main() { int x=5.--x++). %d ". } a. none of the above Ans: d) Lvalue required Q25. 2. 20. 3. y = %d". 20. 11 d.. 4. } } a. } } a. 3.printf ("x = %d. x--). 20. 4 d. %d. printf("%d. 3. 1 d. 1. 10 Ans: c) Q26. j-. 4. none of the above Ans: d) prints nothing. 10.1 b. 4. 5. 20. 10. 9.x!=0. x--). 10 d. 10. 10 b. 5.x==0. printf("%d. 1. --i). 20. j++ . clrscr(). 10. none of the above . 19. } a. 19. 1. 3. 3. 4. 20.x--) { printf("x=%d ". j = 20. x. 2. 2. for(. 10 b. 3. 2. 0 c. main() { int i =10. 0. 1. ++i). 9. 0 b. 2. clrscr(). for(. 9. ". 10 c.

main() { signed int bit=512. 3. 256. 0. } { unsigned int bit=512. Compile error Ans: 256. 3 d. 512. 1. 1. 2. bit).x<= 0. c. 8. 4.Ans: d) Infinite loop as x is decremented twice.i<5. clrscr(). 4 c. 2. 3. x--). 5. for(. 2.x--) { printf("x=%d ". 2. -1. 1 b.i++) { printf("%d ". 512 d. 1. 1. 5. printf("%d". 5 Ans: prints nothing. "3. 16 Ans: d) L does't make any diff. 256. so declaration allowed Q30. -1. 3. 2. bit). as condition in loop is false. 1L << i). main() { { unsigned int bit=256. it never be 0 and loop is going on & on Q28 main() { int x=5. 4. } } a. 3.i--) { printf("%d . 5. 3. 5. for(. clrscr().i. 1 b. } } a. 1. } } a. becoz these r different blocks. Q31. 8 d. 0. 512. for(i=0. 1. Q29. 256 b. 512 c. printf("%d". 4. i=5. main() { int i.

512. 512."). 256. 512."). 32 b. 256. 0 c. main() { signed int bit=512. 256. } else { printf("OK I am gone. 64. 512 d.i--) { printf("%d ". 512.i. } } a. none of the above Ans: a) Q34 main() { if ((1||0) && (0||1)) { printf("OK I am done. } } a. 8. 128.". 32.(i -1))). OK I am gone c. for(. } else { printf("OK I am gone. 512. 0. 0.(i -1)))). 64. OK I am done b. 512. 128. OK I am gone c. 32. 0. 0 b. 8 d. bit = (bit >> (i . bit >> (i . 256. } } a. compile error d. 256 Ans: d) bit's value is not changed Q33. 16. 16 c. main() { if (!(1&&0)) { printf("OK I am done. 256. 256. OK I am done b. i=5. 256. } } a. 16. 256. 64. 0. 256. 64.")."). 32. compile error d. 128. none of the above . 4 Ans: b) Q32.

Aug 14. -513 Ans: d) Like this? +41 -3 Read more: HCL ISD .12 JAN 2010 .12 JUL 2010 . Nov 12.Bapatla. CALICUT.2012 HCL COMNET .HYDERABAD HCL PATTERN & INTERVIEW . 6-Feb-2012 HCL COMNET Interview Pattern . 512. 2010.26 MAR 2010 . printf("%d %d".VADDESWARAM .2010 HCL PATTERN & INTERVIEW .CHENNAI HCL PATTERN & INTERVIEW . September 24.9th Feb 2012 HCL TECHNOLOGIES . 0.2010 HCL TECHNOLOGIES PATTERN & INTERVIEW .Ans: a) Q35 main() { signed int bit=512.09 MAR 2010 .march1st.Bangalore. College of engineering & technology.13 AUG 2010 .visakhapatnam. 0.AVADI HCL PATTERN & INTERVIEW . bit.4th OCT 2011. Orissa HCL Technologies Interview Questions . 2011 HCL . 0.BBD Lucknow . HCL PATTERN . mBit). mBit. December 30. 2011 HCL Interview Pattern . 2012 HCL comnet .Hyderabad. bit = bit & ~bit . 513 c.TAMILNADU HCL PATTERN .Nitte.CHENNAI HCL PAPER . Bhubanswar.JUN 2008 .2010 HCL Placement Paper Pattern . Nov 2.Jalandhar. } } a. 20-Dec-2011 HCL Technologies Interview . 0 b.Allahabad.12 JUL 2010 . { mBit = ~bit.CHITKARA UNIVERSITY on 12 SEP 2012 HCL ISD .11 MAR 2010 HCL PATTERN & INTERVIEW .NATIONAL INSTITUTE OF TECHNOLOGY. 0 d.CHENNAI HCL TECHNOLOGIES MODEL PAPER .

com Bookmark to: Follow us on twitter! .© 2008-2013 by IndiaBIX™ Technologies. All Rights Reserved | Copyright | Terms of Use & Privacy Policy Contact us: info@indiabix.