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

main() { unsigned int i=65000; while(i++!=0); printf("%d",i); }

1 Answers  


#ifdef something int some=0; #endif main() { int thing = 0; printf("%d %d\n", some ,thing); }

1 Answers  


Write a program to implement the motion of a bouncing ball using a downward gravitational force and a ground-plane friction force. Initially the ball is to be projected in to space with a given velocity vector

2 Answers  


Finding a number multiplication of 8 with out using arithmetic operator

8 Answers   Eyeball, NetApp,


void main() { int *i = 0x400; // i points to the address 400 *i = 0; // set the value of memory location pointed by i; }

2 Answers  






write a program to Insert in a sorted list

4 Answers   Microsoft,


main() { int *ptr=(int*)malloc(sizeof(int)); *ptr=4; printf("%d",(*ptr)+++*ptr++); }

3 Answers   GNITC,


Write a Program in 'C' To Insert a Unique Number Only. (Hint: Just Like a Primary Key Numbers In Database.) Please Some One Suggest Me a Better Solution for This question ??

0 Answers   Home,


Given an array of characters which form a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it.

9 Answers   Microsoft,


main() { int i=1; while (i<=5) { printf("%d",i); if (i>2) goto here; i++; } } fun() { here: printf("PP"); }

1 Answers  


main() { int i = 100; clrscr(); printf("%d", sizeof(sizeof(i))); } a. 2 b. 100 c. 4 d. none of the above

5 Answers   HCL,


String reverse with time complexity of n/2 with out using temporary variable.

10 Answers   NetApp, Symantec,


Categories