Monday 18 March 2013

printf("%d==1 is ""%s",k,k==1?"TRUE":"FALSE");


main()
    {
    int k=1;
    printf("%d==1 is ""%s",k,k==1?"TRUE":"FALSE");
    }
Answer:
1==1 is TRUE
Explanation:
When two strings are placed together (or separated by white-space) they are concatenated (this is called as "stringization" operation). So the string is as if it is given as "%d==1 is %s". The conditional operator( ?: ) evaluates to "TRUE".

Blog Author: Vijay Kumar

Go to: Java Aptitude


No comments:

Post a Comment