ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Do you have a collection of Interview Questions and interested to share with us!!
Please send that collection to along with your userid / name. ThanQ
Google
 
Categories  >>  Software  >>  Programming Languages  >>  C
 
 


 

 
 C interview questions  C Interview Questions
 C++ interview questions  C++ Interview Questions
 VC++ interview questions  VC++ Interview Questions
 Delphi interview questions  Delphi Interview Questions
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions
Question
#define MAX(x,y) (x) > (y) ? (x) : (y)
main()
{
  int i = 10, j = 5, k = 0;
  k = MAX(i++, ++j);
  printf("%d %d %d", i,j,k);
}

what will the values of i , j and k?
}
 Question Submitted By :: Sid08
I also faced this Question!!     Rank Answer Posted By  
 
  Re: #define MAX(x,y) (x) > (y) ? (x) : (y) main() { int i = 10, j = 5, k = 0; k = MAX(i++, ++j); printf("%d %d %d", i,j,k); } what will the values of i , j and k? }
Answer
# 1
12 6 11
 
Is This Answer Correct ?    19 Yes 7 No
Guest
 
  Re: #define MAX(x,y) (x) > (y) ? (x) : (y) main() { int i = 10, j = 5, k = 0; k = MAX(i++, ++j); printf("%d %d %d", i,j,k); } what will the values of i , j and k? }
Answer
# 2
11 , 6, 10
 
Is This Answer Correct ?    13 Yes 7 No
Sumi
 
 
 
  Re: #define MAX(x,y) (x) > (y) ? (x) : (y) main() { int i = 10, j = 5, k = 0; k = MAX(i++, ++j); printf("%d %d %d", i,j,k); } what will the values of i , j and k? }
Answer
# 3
12 6 11
 
Is This Answer Correct ?    12 Yes 4 No
Sshireesha
 
  Re: #define MAX(x,y) (x) > (y) ? (x) : (y) main() { int i = 10, j = 5, k = 0; k = MAX(i++, ++j); printf("%d %d %d", i,j,k); } what will the values of i , j and k? }
Answer
# 4
i=12
j=6
k=11
 
Is This Answer Correct ?    6 Yes 7 No
Vignesh1988i
[Nil]
 
  Re: #define MAX(x,y) (x) > (y) ? (x) : (y) main() { int i = 10, j = 5, k = 0; k = MAX(i++, ++j); printf("%d %d %d", i,j,k); } what will the values of i , j and k? }
Answer
# 5
x=11

k=11

j=6
 
Is This Answer Correct ?    1 Yes 11 No
Guest
 
  Re: #define MAX(x,y) (x) > (y) ? (x) : (y) main() { int i = 10, j = 5, k = 0; k = MAX(i++, ++j); printf("%d %d %d", i,j,k); } what will the values of i , j and k? }
Answer
# 6
i=12
j=6
k=11
 
Is This Answer Correct ?    7 Yes 4 No
Vignesh1988i
 
  Re: #define MAX(x,y) (x) > (y) ? (x) : (y) main() { int i = 10, j = 5, k = 0; k = MAX(i++, ++j); printf("%d %d %d", i,j,k); } what will the values of i , j and k? }
Answer
# 7
i=11 j=6 k=10
 
Is This Answer Correct ?    3 Yes 4 No
Amitesh
 
  Re: #define MAX(x,y) (x) > (y) ? (x) : (y) main() { int i = 10, j = 5, k = 0; k = MAX(i++, ++j); printf("%d %d %d", i,j,k); } what will the values of i , j and k? }
Answer
# 8
i=11, j=6 , k=10.
 
bcoz i=10 and j=6 pass to function
then check and give k=x which is k=10
then increament i by 1 i.e i=11.
 
Is This Answer Correct ?    6 Yes 4 No
Amit Kumar Ram
 
  Re: #define MAX(x,y) (x) > (y) ? (x) : (y) main() { int i = 10, j = 5, k = 0; k = MAX(i++, ++j); printf("%d %d %d", i,j,k); } what will the values of i , j and k? }
Answer
# 9
The answer is undefined. It is undefined in C to use the
increment operator more than once in the same expression.

MAX(i++, ++j) expands to:

(i++) > (++j) ? (i++) : (++j)

Which guarantees that either i++ or ++j appears twice in the
expression.

http://blog.emptycrate.com/node/329
 
Is This Answer Correct ?    2 Yes 1 No
Jason
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
How do I declare an array of N pointers to functions returning pointers to functions returning pointers to characters?  1
Write a C Programm.. we press 'a' , it shows the albhabetical number is 1, if we press 'g' it shows the answer 7.. any can help me  4
Write a program to give following output..... ********* **** **** *** *** ** ** * * ** ** *** *** **** **** *********  2
What is the memory allocated by the following definition ? int (*x)(); ADITI2
Look at the Code: main() { int a[]={1,2,3},i; for(i=0;i<3;i++) { printf("%d",*a); a++; } } Which Statement is/are True w.r.t the above code? I.Executes Successfully & Prints the contents of the array II.Gives the Error:Lvalue Required III.The address of the array should not be changed IV.None of the Above. A)Only I B)Only II C)II & III D)IV Accenture3
Difference between fopen() and open()? Aricent3
writw a program to insert an element in the begning of a doubly linked list  1
Is reference used in C?  1
The differences between Windows XP and Windows Visa HCL7
How to implement variable argument functions ? HP1
char ch=10;printf("%d",ch);what is the output Accenture11
how can i get output like this? 1 2 3 4 5 6 Excel3
void main() { int i=5; printf("%d",i+++++i); } ME12
what is the benefit of c30  1
How many ways are there to swap two numbers without using temporary variable? Give the each logic.  6
Explain what?s happening in the first constructor: public class c{ public c(string a) : this() {;}; public c() {;} } How is this construct useful?  1
c programming of binary addition of two binary numbers  1
program to find the roots of a quardratic equation  1
Find the middle node in the linked list?? (Note:Do not use for loop, count and count/2) Subex2
what is the output of below pgm? void main() { int i=0; if(i) printf("pass"); else printf("fail"); }  3
 
For more C Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com