void main()

{

int k=ret(sizeof(float));

printf("\n here value is %d",++k);

}

int ret(int ret)

{

ret += 2.5;

return(ret);

}



void main() { int k=ret(sizeof(float)); printf("\n here value is %d",++k); }..

Answer / susie

Answer :

Here value is 7

Explanation:

The int ret(int ret), ie., the function name and the
argument name can be the same.

Firstly, the function ret() is called in which the
sizeof(float) ie., 4 is passed, after the first expression
the value in ret will be 6, as ret is integer hence the
value stored in ret will have implicit type conversion from
float to int. The ret is returned in main() it is printed
after and preincrement.

Is This Answer Correct ?    8 Yes 0 No

Post New Answer

More C Code Interview Questions

#include<stdio.h> main() { int a[2][2][2] = { {10,2,3,4}, {5,6,7,8} }; int *p,*q; p=&a[2][2][2]; *q=***a; printf("%d----%d",*p,*q); }

1 Answers  


How to palindrom string in c language?

6 Answers   Google,


main() { int i = 3; for (;i++=0;) printf(“%d”,i); }

1 Answers   CSC,


code of a program in c language that ask a number and print its decremented and incremented number.. sample output: input number : 3 321123

1 Answers   HCL,


main( ) { char *q; int j; for (j=0; j<3; j++) scanf(“%s” ,(q+j)); for (j=0; j<3; j++) printf(“%c” ,*(q+j)); for (j=0; j<3; j++) printf(“%s” ,(q+j)); }

1 Answers  






main() { clrscr(); } clrscr();

2 Answers  


why nlogn is the lower limit of any sort algorithm?

0 Answers  


main() { int i=_l_abc(10); printf("%d\n",--i); } int _l_abc(int i) { return(i++); }

2 Answers  


main() { int a[10]; printf("%d",*a+1-*a+3); }

1 Answers  


What is "far" and "near" pointers in "c"...?

3 Answers  


Give a oneline C expression to test whether a number is a power of 2?

25 Answers   EA Electronic Arts, Google, Motorola,


Is the following statement a declaration/definition. Find what does it mean? int (*x)[10];

1 Answers  


Categories