Technical Interview Question/Programs On C & C++
Que. a=5, b=3, c=a,b d=(a,b) Printf(c,d) Ans: c=5, d=3 Ques. int *f1() { int n; return(n) } int *f2() { int *p; *p=3; return p; } int *f3() { int *p; p=malloc(); return p; } Ans: No Error Que: *p+=1 *p++ are these two same? Ans: Not Same Que: func(int i) { static int count; count = count+i; } Ans: 1+2+3.. (Count values does not go after function call) Que: int num[3]; num[3]=2; Ans: First statement deals with SIZE Second statement deals with ELEMENT Que: j=4; for(int i=0;i { j++; ++j; } Output of j=? Ans: 14 Que: Brace "{" used in C for what? Ans: CONVENTION Que: Parameter in C passed by? ...