what is the output for this question:
main()
{
int i=1;
printf("%d%d%d",i,i++,++i);
}
Answer Posted / sumalatha
Ans is 2 2 2
because in printf assosiativity is from left to right
first pre increments i that becomes 2 next post increment
is done after printf stmt so prints 2 again, then simple
print i i.e 2again
last post increnent which i becomes 3 but that is done
after printf stmt
| Is This Answer Correct ? | 1 Yes | 4 No |
Post New Answer View All Answers
What are the salient features of c languages?
When is the “void” keyword used in a function?
What is wrong with this initialization?
Write a program to implement queue.
a linearly ordered set of data elements that have the same structure and whose order is preserved in storage by using sequential allocation a) circular b) ordinary c) array d) linear list
What are the basic data types associated with c?
typedef enum { html, java, javascript, perl, cgi } lang;The above statement defines a : a) Union b) User defined type c) Enumerated variable d) none
What are the 5 types of organizational structures?
How do c compilers work?
Can a file other than a .h file be included with #include?
How can I rethow can I return a sequence of random numbers which dont repeat at all?
Explain how can I avoid the abort, retry, fail messages?
What are multidimensional arrays?
What do header files do?
If i have an array 0 to 99 i.e,(Size 100) I place the values 1 to 100 randomly like a[0]=29,a[1]=56 upto array[99].. the values are only between 1 to 100. getting the array values by using scanf.. If i entered one wrong element value line a[56]=108. how can i find it.. and also how to find the missing value in 1 to 100.. and i want to replace the missing values.. any one of them know please post your answer..