If you have any queries or suggestions in
above c online exam, please share it.
C language interview questions solution for freshers beginners placement tricky good pointers answers explanation operators data types arrays structures functions recursion preprocessors looping file handling strings switch case if else printf advance linux objective mcq faq online written test prime numbers Armstrong Fibonacci series factorial palindrome code programs examples on c++ tutorials and pdf
40 comments:
Could anyone please point me to an explanation of Q5. It's driving me mad! Thanks.
i is incremented 3 times hence i becomes 3 then
num=a[++i+a[++i]]+a[++i];
num=a[3+a[3]]+a[3]=a[3+3]+3=a[6]+3=6+3=9
explanation for Q1,7,13,18,19 pls.............if any1 knows.........thnx in advance.........
can any body make understand of logic of q6.
@pavan
sizeof f(i)=2,
f(1)=1*5=5,
f(0)=0*5=0,
val=2+5+0;
i=1 //as f(i=1) changes the value of i in memory
can anyone plz explain the ques no 16 and 18,both are mostly same just a difference of 3.5 and 3.3 then how the answers are different?can anyone explain plzzzzzz
Q 7 correct answer is E
error:Lvalue required!!
Ans of Q.7 is 9.
Q7 Compiled in vc
error C2106: '+=' : left operand must be l-value
explain me 12,14,15,19
the answer of 1st question is (a) equal.......
seventh question answer is A not D
since i=8 and i=i+1; then i=9
hi have anyone tried 2 question. i am compiling in linux gcc compiler and getting no answer
it just runs but no out put but here its written that it gives an output at option c .
answer to 1 question is e only. because #if is a preprocessor.
Answer to question 7 is since (i=8) will be evaluated first which will be a constant value and thus a lvalue error
answer to question 13 must be a i.e 0
really good job ... questions quality is bessst ... :)
ans to question no .6 on compilation i got val=9 and i=1.here given val=7 and i=1...can anyone plz explain
i thnk some answers are wrong...
can u plz reevaluate the answers???
please do make questions which do not include 'compilation error' as an option! Thank you!
answer for the question 13 is i.e, x=!a+change(); is 0
convert 3.5 as binary 0000 0011.1(non repeating) where as 3.3 in binary form is
0000 0011.010011001..(the last 1001 bits are reoccuring) real data by default is considered as double(ie 8 bytes) so the representation in IEEE of duble for 3.3(reoccuring bits after decimal)is differnt from IEEE form of float .
but in case of 3.5 there is only an additional increase in number of 0's in double IEEE from that of float IEEE.
hence (float)3.5 == 3.5 .
Please tell me the explaination for the q4
Output of Q.1 is Equal..how??
int a=5;
{
int b=10;
++b; //b=11
++a; //a=6
{
int a=20;
++a; //a=21
a=++b; //b=12
} // a=21 closes here
++a; //a=7
++b; //b=13
printf("%d %d",a,b); //a=7, b=13
}
printf(" %d",a); //a=7
}
can you tell me output of first question?
nice set of question
a[++i+a[++i]]+a[++i];
ans:7.
exp: precedence level start from left to right this square bracket [].
i=0;
a[++i+a[++i]]=a[2 + a[2]]+a[3]=a[4]+a[3]=7.
note;after incrementing allocating the same variable value in same i th location it is a[2+a[2]].now adding a[4].
bcz precedence level are low in '+' addition .don’t think a[2+a[1]] i is the only memory location here it will change
#include
#include
void main(){
int i=3,val;
val=sizeof f(i)+ +f(i=1)+ +f(i-1);
printf("%d %d",val,i);
}
int f(int num){
return num*5;
}
...........................
function returns decimal means it is a integer so memory size is 4 bytes and rest of thing is 5 and 0
output is 4+5+0=9 .............ok
please code me
*
* *
* * *
1 * * * *
where [1=space]
#preprocessor is just a Text-Replace, the compiler gets if (without #)
Q14, should be runtime error or core dump since var1 does not point any. Am I wrong? Can somebody clarify this?
For Q19, I think it should be core dump as like Q14 because memccpy(p2,p1,'\0',sizeof(STU1));
Am I wrong? Can somebody clarify
Can anybody give brief explanation on all ques solutions??........plzzzzz
Can anybody explain the ques 11,12,13,19....plzz
#include
int main(){
int a=0;
#if (a==0)
printf("Equal");
#else if
printf("Not equal");
#endif
return 0;
}
already we intialized that a==0 then it 0==0 means the comparision its true then the output be printed as equal
Correct answer is 7
hi i need q14.
#include
typedef struct cquestionbank{
int num;
struct cquestionbank **p;
struct cquestionbank ***q;
}cqb;
int main(){
static cqb *var1,**var2;
cqb temp={5,&var1,&var2};
var2=&var1;
var1->num=25;
printf("%d %d ",**(temp.q),***(temp.q));
return 0;
}
explanation clearly....i have little bit confuse...please explain clearly
thanks for advance,
ramesh
q 12: 7 8 11 15,how the c value comes to 15
Q1 answer should be "Equal" not compilation error
Plzz explain question no:5
Post a Comment