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++ Questions I_icon_minitimeWed Dec 08, 2010 8:26 pm by ARUNTHATHIMOHAN

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Top posters
Admin
C,C++ Questions I_vote_lcapC,C++ Questions I_voting_barC,C++ Questions I_vote_rcap 
sarathbabu
C,C++ Questions I_vote_lcapC,C++ Questions I_voting_barC,C++ Questions I_vote_rcap 
Divya
C,C++ Questions I_vote_lcapC,C++ Questions I_voting_barC,C++ Questions I_vote_rcap 
kanimozhi
C,C++ Questions I_vote_lcapC,C++ Questions I_voting_barC,C++ Questions I_vote_rcap 
SUBASRI
C,C++ Questions I_vote_lcapC,C++ Questions I_voting_barC,C++ Questions I_vote_rcap 
venkatesh
C,C++ Questions I_vote_lcapC,C++ Questions I_voting_barC,C++ Questions I_vote_rcap 
samson
C,C++ Questions I_vote_lcapC,C++ Questions I_voting_barC,C++ Questions I_vote_rcap 
manickaraaj
C,C++ Questions I_vote_lcapC,C++ Questions I_voting_barC,C++ Questions I_vote_rcap 
Mathivanan
C,C++ Questions I_vote_lcapC,C++ Questions I_voting_barC,C++ Questions I_vote_rcap 
ARUNTHATHIMOHAN
C,C++ Questions I_vote_lcapC,C++ Questions I_voting_barC,C++ Questions I_vote_rcap 
Gallery
C,C++ Questions Empty
Poll
Which Internet Browser do you prefer?
Internet Explorer(IE)
C,C++ Questions I_vote_lcap8%C,C++ Questions I_vote_rcap
 8% [ 1 ]
Netscape
C,C++ Questions I_vote_lcap0%C,C++ Questions I_vote_rcap
 0% [ 0 ]
Opera
C,C++ Questions I_vote_lcap8%C,C++ Questions I_vote_rcap
 8% [ 1 ]
mozilla firefox
C,C++ Questions I_vote_lcap33%C,C++ Questions I_vote_rcap
 33% [ 4 ]
google chrome
C,C++ Questions I_vote_lcap17%C,C++ Questions I_vote_rcap
 17% [ 2 ]
Epic Browser
C,C++ Questions I_vote_lcap25%C,C++ Questions I_vote_rcap
 25% [ 3 ]
Other
C,C++ Questions I_vote_lcap8%C,C++ Questions 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++ Questions

Go down 
AuthorMessage
sarathbabu




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

C,C++ Questions Empty
PostSubject: C,C++ Questions   C,C++ Questions I_icon_minitimeMon Aug 23, 2010 3:31 am

1. Base class has some virtual method and derived class has a method with the same name. If we initialize the base class pointer with derived
object,. calling of that virtual method will result in which method being called? 
a. Base method
b. Derived method..
Ans. b
2. For the following C program
#define AREA(x)(3.14*x*x)
main()
{float r1=6.25,r2=2.5,a;
a=AREA(r1);
printf("\n Area of the circle is %f", a);
a=AREA(r2);
printf("\n Area of the circle is %f", a);
}
What is the output?
Ans. Area of the circle is 122.656250
        Area of the circle is  19.625000
3. What do the following statements indicate. Explain.
· int(*p)[10]
· int*f()
· int(*pf)()
· int*p[10]
Refer to:
-- Kernighan & Ritchie page no. 122
-- Schaum series page no. 323
4.
void main()
{
int d=5;
printf("%f",d);
}
Ans: Undefined




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

6.
void main()
{
char *s="\12345s\n";
printf("%d",sizeof(s));
}
Ans: 6

7.
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(iprintf("less");
else
if(i>j)
printf("greater");
else
if(i==j)
printf("equal");
}
Ans: less




8.
void main()
{
float j;
j=1000*1000;
printf("%f",j);
}

1. 1000000
2. Overflow
3. Error
4. None
Ans: 4

9.  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:

    1. char *(*(*a[N])())();

    2. 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... */

    3. 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.)


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

11. In the above question an array of pointers is declared.
    Write the statement to initialize the 3rd element of the 2 element to 10;

12.
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.
Basketball
Back to top Go down
 
C,C++ Questions
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: