ENiAC
Would you like to react to this message? Create an account in a few clicks or log in to continue.

ENiAC

Pioneer college of Arts and Science | BSc & BCA Student forum
 
HomeSearchLatest imagesRegisterGalleryLog in
Congratulations to University Rank Holders: B.C.A: K.Sathyavaishnavi-I RANK, S.Maheswari-V RANK | M.Sc: S.Samanthadevi-III RANK, T.Ambika-IV RANK, S.Sharmila-VI RANK | M.Com: K.Malathi- V RANK, F.Aseena-VIII RANK, R.Saravanakumar-X RANK.
Latest topics
» NANO TECHNOLOGY
C,C++ Questions2 I_icon_minitimeWed Dec 08, 2010 8:26 pm by ARUNTHATHIMOHAN

» Kaspersky 35 years validity key... amazing hack..
C,C++ Questions2 I_icon_minitimeSun Dec 05, 2010 9:06 am by sarathbabu

» Mobile telephony standards[0G,1G,2G,3G,4G,5G technology]
C,C++ Questions2 I_icon_minitimeSun Dec 05, 2010 4:14 am by sarathbabu

» 3G Technology
C,C++ Questions2 I_icon_minitimeSun Dec 05, 2010 4:09 am by sarathbabu

» Detail about IMEI number
C,C++ Questions2 I_icon_minitimeSun Dec 05, 2010 4:03 am by sarathbabu

» SIM CARD[meaning]
C,C++ Questions2 I_icon_minitimeSun Dec 05, 2010 3:59 am by sarathbabu

» smartphone
C,C++ Questions2 I_icon_minitimeSun Dec 05, 2010 3:55 am by sarathbabu

» Blender [animation] must see.....
C,C++ Questions2 I_icon_minitimeSun Dec 05, 2010 3:49 am by sarathbabu

» Blender [animation]
C,C++ Questions2 I_icon_minitimeSun Dec 05, 2010 3:49 am by sarathbabu

» GPS System Technology
C,C++ Questions2 I_icon_minitimeSat Nov 20, 2010 6:36 pm by venkatesh

» கண்களை நம்பாதீர்கள்
C,C++ Questions2 I_icon_minitimeWed Nov 17, 2010 11:06 pm by Admin

» CSS – ஆரம்ப வழிகாட்டி தமிழில்.
C,C++ Questions2 I_icon_minitimeWed Nov 17, 2010 10:52 pm by Admin

» Top 10 Latest Inventions
C,C++ Questions2 I_icon_minitimeSat Nov 13, 2010 10:24 pm by venkatesh

» கணினியை பராமரிக்க எழிய வழிமுறைகள்
C,C++ Questions2 I_icon_minitimeSat Nov 13, 2010 10:18 pm by venkatesh

» Easy To Pick The Wndows Xp Key
C,C++ Questions2 I_icon_minitimeSat Nov 13, 2010 10:12 pm by venkatesh

Top posters
Admin
C,C++ Questions2 I_vote_lcapC,C++ Questions2 I_voting_barC,C++ Questions2 I_vote_rcap 
sarathbabu
C,C++ Questions2 I_vote_lcapC,C++ Questions2 I_voting_barC,C++ Questions2 I_vote_rcap 
Divya
C,C++ Questions2 I_vote_lcapC,C++ Questions2 I_voting_barC,C++ Questions2 I_vote_rcap 
kanimozhi
C,C++ Questions2 I_vote_lcapC,C++ Questions2 I_voting_barC,C++ Questions2 I_vote_rcap 
SUBASRI
C,C++ Questions2 I_vote_lcapC,C++ Questions2 I_voting_barC,C++ Questions2 I_vote_rcap 
venkatesh
C,C++ Questions2 I_vote_lcapC,C++ Questions2 I_voting_barC,C++ Questions2 I_vote_rcap 
samson
C,C++ Questions2 I_vote_lcapC,C++ Questions2 I_voting_barC,C++ Questions2 I_vote_rcap 
manickaraaj
C,C++ Questions2 I_vote_lcapC,C++ Questions2 I_voting_barC,C++ Questions2 I_vote_rcap 
Mathivanan
C,C++ Questions2 I_vote_lcapC,C++ Questions2 I_voting_barC,C++ Questions2 I_vote_rcap 
ARUNTHATHIMOHAN
C,C++ Questions2 I_vote_lcapC,C++ Questions2 I_voting_barC,C++ Questions2 I_vote_rcap 
Gallery
C,C++ Questions2 Empty
Poll
Which Internet Browser do you prefer?
Internet Explorer(IE)
C,C++ Questions2 I_vote_lcap8%C,C++ Questions2 I_vote_rcap
 8% [ 1 ]
Netscape
C,C++ Questions2 I_vote_lcap0%C,C++ Questions2 I_vote_rcap
 0% [ 0 ]
Opera
C,C++ Questions2 I_vote_lcap8%C,C++ Questions2 I_vote_rcap
 8% [ 1 ]
mozilla firefox
C,C++ Questions2 I_vote_lcap33%C,C++ Questions2 I_vote_rcap
 33% [ 4 ]
google chrome
C,C++ Questions2 I_vote_lcap17%C,C++ Questions2 I_vote_rcap
 17% [ 2 ]
Epic Browser
C,C++ Questions2 I_vote_lcap25%C,C++ Questions2 I_vote_rcap
 25% [ 3 ]
Other
C,C++ Questions2 I_vote_lcap8%C,C++ Questions2 I_vote_rcap
 8% [ 1 ]
Total Votes : 12
Social bookmarking
Social bookmarking reddit      

Bookmark and share the address of ENiAC on your social bookmarking website

Bookmark and share the address of ENiAC on your social bookmarking website
Search
 
 

Display results as :
 
Rechercher Advanced Search

 

 C,C++ Questions2

Go down 
AuthorMessage
sarathbabu




Posts : 57
Reputation/vote (வாக்கு) : 0
Join date : 2010-08-23
Age : 33
Location : COIMBATORE

C,C++ Questions2 Empty
PostSubject: C,C++ Questions2   C,C++ Questions2 I_icon_minitimeMon Aug 23, 2010 3:33 am

13.
void main()
{
int i=7;
printf("%d",i++*i++);
}

Ans: 56

14.
#define one 0
#ifdef one
printf("one is defined ");
#ifndef one
printf("one is not defined ");

Ans: "one is defined"




15.
void main()
{
int count=10,*temp,sum=0;
temp=&count;
*temp=20;
temp=∑
*temp=count;
printf("%d %d %d ",count,*temp,sum);
}

Ans: 20 20 20


16. There was question in c working only on unix machine with pattern matching.


14. what is alloca()
Ans : It allocates and frees memory after use/after getting out of scope

17.
main()
{
static i=3;
printf("%d",i--);
return i>0 ? main():0;
}

Ans: 321

18.
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.

19.
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"
20. Output of the following program is
main()
{int i=0;
for(i=0;i<20;i++)
{switch(i)
case 0:i+=5;
case 1:i+=2;
case 5:i+=5;
default i+=4;
break;}
printf("%d,",i);
}
}
a) 0,5,9,13,17
b) 5,9,13,17
c) 12,17,22
d) 16,21
e) Syntax error
Ans. (d)
21. What is the ouptut in the following program
main()
{char c=-64;
int i=-32
unsigned int u =-16;
if(c>i)
{printf("pass1,");
if(cprintf("pass2");
else
printf("Fail2");
}
else
printf("Fail1);
if(iprintf("pass2");
else
printf("Fail2")
}
a) Pass1,Pass2
b) Pass1,Fail2
c) Fail1,Pass2
d) Fail1,Fail2
e) None of these
Ans. (c)
22. What will the following program do?
void main()
{
int i;
char a[]="String";
char *p="New Sring";
char *Temp;
Temp=a;
a=malloc(strlen(p) + 1);
strcpy(a,p); //Line number:9//
p = malloc(strlen(Temp) + 1);
strcpy(p,Temp);
printf("(%s, %s)",a,p);
free(p);
free(a);
} //Line number 15//
a) Swap contents of p & a and print:(New string, string)
b) Generate compilation error in line number 8
c) Generate compilation error in line number 5
d) Generate compilation error in line number 7
e) Generate compilation error in line number 1
Ans. (b)
23. In the following code segment what will be the result of the function,
value of x , value of y
{unsigned int x=-1;
int y;
y = ~0;
if(x == y)
printf("same");
else
printf("not same");
}
a) same, MAXINT, -1
b) not same, MAXINT, -MAXINT
c) same , MAXUNIT, -1
d) same, MAXUNIT, MAXUNIT
e) not same, MAXINT, MAXUNIT
Ans. (a)
24. What will be the result of the following program ?
char *gxxx()
{static char xxx[1024];
return xxx;
}
main()
{char *g="string";
strcpy(gxxx(),g);
g = gxxx();
strcpy(g,"oldstring");
printf("The string is : %s",gxxx());
}
a) The string is : string
b) The string is :Oldstring
c) Run time error/Core dump
d) Syntax error during compilation
e) None of these
Ans. (b)
25. 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
affraid
Back to top Go down
 
C,C++ Questions2
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
ENiAC :: Interview preperation and Placement Papers-
Jump to: