Placement Questions & Answers C Language
Analyze the code and print the output#include
int giValue = 5;
void fnReverse() {
if ( giValue > 0 ) {
giValue--;
fnReverse();
}
printf("\n%d", giValue);
}
int main(){
fnReverse();
printf("\n");
return 0;
}
How does the layout change when you make the following
changes to the function main
void main() {
int c, *b, **a, *d;
c = 4;
b = &c;
a = &b;
b = (int *)malloc(sizeof(int));
*b = 2;
d = (int *)realloc(b, 2*sizeof(int));
printf("Answer =%d\n", f(c,b,a));
}
Can you detect a memory leak in the program ? Is there a fix ?
What will be the output when we change the statement
int j = 2 << 1; to int j = -2 << 1;
What will be the output if we change the statement
int j = 2 << 1; to int j = 2 << 2;
What will happen to the output when we change the
statement
i |= j; to i = i ^ ~j
Analyze the code and print the output
#include
void main() {
static int a[3][3]={1,2,3,4,5,6,7,8,9};
int i,j;
static *p[]={a,a+1,a+2};
for(i=0;i<3 font="" i="">3>
for(j=0;j<3 font="" j="">3>
printf("%d\t%d\t%d\t%d\n",*(*(p+i)+j),
*(*(j+p)+i),*(*(i+p)+j),*(*(p+j)+i));
}
}
Hi, Thanks for sharing. Very informative post, that I have ever read, the strategy given is really very helpful....Here I’m giving best PLACEMENT ONLINE TRAINING details, once go through it.
ReplyDeletePLACEMENT PAPERS