Programming in C - Constants, Variables and Data Types

31. If integer needs two bytes of storage, then maximum value of a signed integer is

  • Option : B
  • Explanation :
    In signed magnitude form, one bit is dedicated to store the sign. (e.g.. 1 for negative and 0. otherwise). Only the remaining 15 bits arc available to store the magnitude. Hence the answer.
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 *


32. printf ( "%d" , printf ( "tim" ) ):

  • Option : B
  • Explanation :
    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).
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 *


33. 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 *


34. Consider the statements

  • Option : B
  • Explanation :
    The input is actually a \ n b. Since we are reading only two characters, only a and \ will be read and printed.
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 *


35. Literal means

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 *