Note that there are some explanatory texts on larger screens.

plurals
  1. POIs it true printf takes first two assignment as input
    primarykey
    data
    text
    <p>i read somewhere that printf takes the values of the first two assignments of the program. Any number of printf's may be given. All of them take only the first two values. If more number of assignments given in the program,then printf will take garbage values.</p> <p>i don't think so but it was given on many websites so just need to confirm it</p> <p>For example, if you do a simple Google search for <code>"printf takes first two assignment as input"</code> there are sites that have sample interview question/answers such as:</p> <blockquote> <p>Predict the output or error(s) for the following:</p> </blockquote> <pre><code>main() { int i=400,j=300; printf("%d..%d"); } </code></pre> <blockquote> <p>Answer: 400..300</p> <p>Explanation: printf takes the values of the first two assignments of the program. Any number of printf's may be given.</p> <p>All of them take only the first two values. If more number of assignments given in the program,then printf will take garbage values.</p> </blockquote> <p>Is this the correct true behavior? or is it implementation dependent?</p> <p>You can find such Q&amp;A places like:<br> <a href="http://www.c-puzzles.thiyagaraaj.com/puzzles-a.html" rel="nofollow">this puzzle site</a><br> and <a href="http://www.google.com/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;frm=1&amp;source=web&amp;cd=2&amp;cad=rja&amp;ved=0CDoQFjAB&amp;url=http%3A%2F%2Fwww.utdallas.edu%2F~veerasam%2Fc_c%2B%2B%2Fweb-download%2FC%2520Interview%2520Questions.docx&amp;ei=S4v1UNHPLsW30AG1sIGICQ&amp;usg=AFQjCNFtT_n5za1F6TX4ggEHK9wzpe56ig&amp;sig2=4_lHjKaaOZZQ_mcgfjoKuQ" rel="nofollow">this interview question doc</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload