CP CVDT Q33

0. If abc is the input, then the following program fragment
char x, y, z ;
printf ("% d" , scanf ("%c%c%c" , &x , &y , &z )) ;
results in

  • Option : D
  • Explanation :
    Take reference from below.
    Any function (including main ( ) ) , returns a value to the calling environment. In the case of printf, it is the number of characters it printed. So. the output will be tim3 (since it printed the three characters a, b, c).
    The scanf function returns the number of successful matches. i.e., 3 in this case.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *