void pascal f(int i,int j,int k)

{

printf(“%d %d %d”,i, j, k);

}

void cdecl f(int i,int j,int k)

{

printf(“%d %d %d”,i, j, k);

}

main()

{

int i=10;

f(i++,i++,i++);

printf(" %d\n",i);

i=10;

f(i++,i++,i++);

printf(" %d",i);

}



void pascal f(int i,int j,int k) { printf(“%d %d %d”,i, j, k); } ..

Answer / susie

Answer :

10 11 12 13

12 11 10 13

Explanation:

Pascal argument passing mechanism forces the arguments
to be called from left to right. cdecl is the normal C
argument passing mechanism where the arguments are passed
from right to left.

Is This Answer Correct ?    5 Yes 0 No

Post New Answer

More C Code Interview Questions

Develop a routine to reflect an object about an arbitrarily selected plane

0 Answers  


void main() { unsigned giveit=-1; int gotit; printf("%u ",++giveit); printf("%u \n",gotit=--giveit); }

1 Answers  


plz send me all data structure related programs

2 Answers  


‎#define good bad main() { int good=1; int bad=0; printf ("good is:%d",good); }

2 Answers  


struct point { int x; int y; }; struct point origin,*pp; main() { pp=&origin; printf("origin is(%d%d)\n",(*pp).x,(*pp).y); printf("origin is (%d%d)\n",pp->x,pp->y); }

1 Answers  






how to return a multiple value from a function?

5 Answers   Wipro,


#include<stdio.h> int main() { int a=3,post,pre; post= a++ * a++ * a++; a=3; pre= ++a * ++a * ++a; printf("post=%d pre=%d",post,pre); return 0; }

3 Answers  


main() { char *str1="abcd"; char str2[]="abcd"; printf("%d %d %d",sizeof(str1),sizeof(str2),sizeof("abcd")); }

1 Answers  


¦void main() ¦{ ¦int i=10,j; ¦ j=i+++i+++i; ¦printf("%d",j); ¦getch(); ¦} ¦ output:-30 but in same question if we write as- ¦void main() ¦{ ¦int i=10; ¦ int j=i+++i+++i; ¦printf("%d",j); ¦getch(); ¦} ¦ output:-33 why output is changed from 30 to 33. Can any body answer...

3 Answers  


How do I write a program to print proper subset of given string . Eg :input: abc output:{},{a},{b},{c},{a,b},{a,c},{b,c}, {a,b,c}.I desperately need this program please mail me to saravana6m@gmail.com

11 Answers   Deshaw, Infosys,


program to find the roots of a quadratic equation

14 Answers   College School Exams Tests, Engineering, HP, IIIT, Infosys, Rajiv Gandhi University of Knowledge Technologies RGUKT, SSC,


main() { static int var = 5; printf("%d ",var--); if(var) main(); }

1 Answers  


Categories