what will be printed by this printf?
printf("%c",printf("hi")["sharkselva"]));
}
Answers were Sorted based on User's Feedback
Answer / vadivelt
Ans: hia
Reason is, in the below statement,
printf("%c",printf("hi")["sharkselva"]));
printf("hi") shall be executed first. and this printf will
return the value 2. ie., no of characters successfully
printed by printf()statement.
So in runtime, "printf("%c",printf("hi")["sharkselva"]));"
will print "hi" and after, the main printf shall be
replaced as "printf("%c",2["sharkselva"]));".
According to printf() implementation, printf("%c",2
["sharkselva"]));" has to print the value at the array, for
the index given ie., 2. So in the array index '2',
character 'a' is available.
Now a is printed.
So the total output will be -> hia
| Is This Answer Correct ? | 31 Yes | 1 No |
the output will be #include<stdio.h> int main () { int i; i = 9/2; printf("%i",i); return 0; }
What is mean by Data Driven framework in QTP? Can any one answer me in details on this regard.
What is the use of a conditional inclusion statement in C?
What do you mean by team??
What is pragma in c?
the maximum width of a c variable name can be a) 6 characters b) 8 characters c) 10 characters d) 20 characters
When should structures be passed by values or by references?
Are there any problems with performing mathematical operations on different variable types?
Who developed c language?
What are the types of i/o functions?
What are enumerated types?
Define function pointers?