Community Sites
Create your own community website and start earning today !
It's Free !
 
Communities Members BookmarksPolls Fresher Jobs Funny Pictures MCA Projects New Member FAQ  



My Profile
Active Members
TodayLast 7 Days more...



Awards & Gifts
Online Exams

Fresher Jobs


Our fresher job section is exclusively for fresh graduates! Find jobs for freshers in major Indian cities including Bangalore, Chennai, Hyderabad, Pune or Kochi

Resources


Find educational articles, blogs, discussion threads and other resources.

Colleges


Find details about any college in India or search for courses.

website counter




HCL PLACEMENT PAPER


Posted Date: 25 Mar 2008    Resource Type: Articles/Knowledge Sharing    Category: Placement Papers

Posted By: Praveen Kumaar       Member Level: Gold
Rating:     Points: 5



1.which of the following about the following two declarations is true
i) int *F();
ii)int (*F)();
a)Both are identical b)the first is a correct declaration and second is wrong
c)the first declaration is a function returning a pointer to an integer and the second is a pointer to a function
returning int
d)Both are different ways of declaring pointer to a function (ans. (c))

2.what are the values printed by the following program?
#define dprintf(expr) printf("expr=%d\n”,expr)
main() {
int x=7;
int y=3;
dprintf(x/y); }
a)#2=2 b)expr=2 c)x/y=2 d)none (ans.( c))

3.which of the following is true of the following program
main() {
char *c;
int *ip;
c=(char *)malloc(100);
ip=(int *)c;
free(ip); }
a)the code functions properly by releasing all the memory allocated
b)results in compilation error as a pointer of various types cannot be equated
c)the program ties to free more memory than allocated and results in run time error
d) works well except when the machine runs low on memory and malloc is unabel to allocate the memory (ans. (d))

4.output?
main() {
int i;
char *p;
i=0x89;
p=(char *)i;
p++;
printf(“%x\n”p); }
a)0x8c b)0x4566788A c)0x8A d)0x8B e)none (ans. (c))

5.which of the following is not an ANSI C language keyword?
a)volatile b)function c)default d)const e)void (ans. (b))

6.when an array is passed as parameter to a function , which of the following statement is correct
the function can change values in the original array
in c parameters are passed by value the function cannot change the original value in the array
it results in compilation error.Array cannot be passed as a parameter to a function
results in runtime error when the function tries to access the elements in the array

7.the type of the controlling expression of a switch statement cannot be of the type
a)int b)char c)short d)float e)none (ans.(d))

8.value of (3^6)+(a ^a)=? (Ans. value=5)

9.x= b>8?b<<3:b>4?b>>1:b; (ans. x=3)

10.output:
main() {
int n=2;
printf(“%d %d\n”,++n,n*n); }
a)3,6 b)3,4 c)2,4 d)cannot determine (ans.( b))

11.output:
int x=0x65;
main() {
char x;
printf(“%d\n”,x); }
a) Compilation error b)’A’ c)65 d)undefined

12.output
main() {
int a=10;
int b=6;
if(a=3)
b++;
printf(“%d %d”,a,b++); }
a)10,6 b)10,7 c)3,6 d)3,7 e)none

13.main() {
enum months {jan=1,feb,mar,apr};
months x=jan;
if(x==1)
printf(“jan is the first month”); }
a)does not print anything b)prints : jan is the first month
c)generates compilation error d)results in runtime error (ans. (c))

14.what is the output of the following program?
Main() {
char *src=”hello world”;
char dst[100];
strcpy(src,dst);
printf(“%s”,dst); }
strcpy(char *dst,char *src) {
while (*src) *dst++=*src++; }
a)”hello world” b)”hello” c)”world” d)NULL e)undefined (ans. (e))

15.main() {
int i=6;
switch(i) {
default: i+=2;
case 4;i=4;
case 5:i++;
break; }
printf(“%d”,i); }
a)8 b)6 c)5 d)4 e)none (ans. (c))

16.main() {
int x=20;
int y=10;
swap(x,y);
printf(“%d %d”,y,x+2); }
swap(int x,int y) {
int temp;
temp=x;
x=y;
y=temp; }
a)10,20 b)20,12 c)22,10 d)10,22 e)none


17.#define INC(x) x++
main() {
int x=4;
printf(“%d”,INC(x++)); }
a)4 b)5 c)6 d)compilation error e)runtime error (ans.(d))

18.struct node{
char *word;
int count;
struct node left;
struct node right; };
a)incorrect definiton b)structures cannot refer to other structrues
c)structures can refer to themselves. Hence the statement is ok
d)structures can refer to maximum of one other structure


19.what is the size of the following union
union tag{
int a;
float b;
char c; };
a)2 b)4 c)1 d)7 (ans.(b))

20. main() {
char s[]=”hello world”;
printf(“%15.10s”,s); }
a)hello,.world… b)…..hello world c)heloo,.wor….. d)none of the above (ans.(b))




Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: CTS APTITUDE QUESTION PAPER
Previous Resource: INFOSYS PAPER
Return to Discussion Resource Index
Post New Resource
Category: Placement Papers


Post resources and earn money!
 
Related Resources

Watch TV Channels



Contact Us    Editors    Privacy Policy    Terms Of Use   

SpiderWorks Technologies Pvt Ltd. 2006 - 2007 All Rights Reserved.