ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   SiteMap shows list of All Categories in this site.
Google
 
Categories  >>  Software  >>  Programming Languages  >>  C
 
 


 

 
 C interview questions  C Interview Questions
 C++ interview questions  C++ Interview Questions
 VC++ interview questions  VC++ Interview Questions
 Delphi interview questions  Delphi Interview Questions
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions
Question
18)struct base {int a,b;
base();
int virtual function1();
}
struct derv1:base{
int b,c,d;
derv1()
int virtual function1();
}
struct derv2 : base
{int a,e;
}
base::base()
{
a=2;b=3;
}
derv1::derv1(){
b=5;
c=10;d=11;}
base::function1()
{return(100);
}
derv1::function1()
{
return(200);
}
main()
base ba;
derv1 d1,d2;
printf("%d %d",d1.a,d1.b)
o/p is
a)a=2;b=3;
b)a=3; b=2;
c)a=5; b=10;
d)none
19) for the above program answer the following q's
main()
base da;
derv1 d1;
derv2 d2;
printf("%d %d %d",da.function1(),d1.function1(),d2.function1
());
o/p is
a)100,200,200;
b)200,100,200;
c)200,200,100;
d)none
20)struct {
int x;
int y;
}abc;
you can not access x by the following
1)abc-->x;
2)abc[0]-->x;
abc.x;
(abc)-->x;
a)1,2,3
b)2&3
c)1&2
d)1,3,4
 Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By  
 
  Re: 18)struct base {int a,b; base(); int virtual function1(); } struct derv1:base{ int b,c,d; derv1() int virtual function1(); } struct derv2 : base {int a,e; } base::base() { a=2;b=3; } derv1::derv1(){ b=5; c=10;d=11;} base::function1() {return(100); } derv1::function1() { return(200); } main() base ba; derv1 d1,d2; printf("%d %d",d1.a,d1.b) o/p is a)a=2;b=3; b)a=3; b=2; c)a=5; b=10; d)none 19) for the above program answer the following q's main() base da; derv1 d1; derv2 d2; printf("%d %d %d",da.function1(),d1.function1(),d2.function1 ()); o/p is a)100,200,200; b)200,100,200; c)200,200,100; d)none 20)struct { int x; int y; }abc; you can not access x by the following 1)abc-->x; 2)abc[0]-->x; abc.x; (abc)-->x; a)1,2,3 b)2&3 c)1&2 d)1,3,4
Answer
# 1
18) d 
o/p is 
2 5
19)
d
o/p is
100 200 100
20) none
Answer is 1,2 & 4.
 
Is This Answer Correct ?    2 Yes 0 No
Naresh S
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
write a prgram of swapping with 2 valiables  6
Find errors (1) m = ++a*5; (2) a = b ++ -c*2; (3)y = sqrt (1000);  4
I have a function which accepts a pointer to an int. How can I pass a constant like 5 to it?  3
What's wrong with "char *p; *p = malloc(10);"?  5
What is an anonymous union and where to apply that ? HP3
char ch="{'H','I',0};printf("%s",ch);what is output Accenture9
int *a[5] refers to TCS8
what is op? for(c=0;c=1000;c++) printf("%c",c); Trigent19
what will be the output off the following program? #include<stdio.h> int main() { int a; a=015+0*71+5; printf("%d,a"); return0; } HCL5
though sbi was nationalized why its not comes under nationalized banks and its comes under publicsector banks SBI2
FIND THE OUTPUT IF THE INPUT IS 5 5.75 void main() { int i=1; float f=2.25; scanf("%d%f",&i,&f); printf("%d %f",,i,f); } ANSWER IS 5 AND 2.25 WHY? Wipro4
i want explaination about the program and its stack reprasetaion fibbo(int n) { if(n==1 or n==0) return n; else return fibbo(n-1)+fibbo(n-2); } main() { fibbo(6); }  2
how can i sort numbers from ascending order and descending order using turbo c..  1
#include<stdio.h> int fun(); int i; int main() { while(i) { fun(); main(); } printf("hello \n"); return 0; } int fun() { printf("hi"); } answer is hello.how??wat is tat while(i) mean? Intel5
7. Identify the correct argument for the function call fflush() in ANSI C: A)stdout B)stdin C)stderr D)All the above Accenture8
main() {int a=200*200/100; printf("%d",a); } TCS12
will the program compile? int i; scanf(“%d”,i); printf(“%d”,i);  3
second highest number in a given set of numbers TCS3
actually i have 2 years teaching experience as computer faculty but now i am a DBA but when i go for interview many peoples asked me why i left my teaching profession and why i want to come in this field kindly give me the proper answer of this queston  3
What is external and internal variables What is dynamic memory allocation what is storage classes in C  3
 
For more C Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2009  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com