Programming in C - I/O Operations

36.
What is the output of the following 'C' program?
main()
{
int a[5]={2,3};
printf("\n%d%d%d",a[2],a[3],a[4]);
}

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 *


37. What is the output of the following 'C' program? main() { printf("%f",sqrt(36.0)); }

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 *


38. If following variables are set to the values as shown below, then what is the value of the expression following it? answer=2; marks=10; !((answer2))

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 *


39. Consider following statements:
putchar(getchar());
putchar(getchar());
If
a
b
is the input, then output will be

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


40. The program fragment
int i =263;
purchar(i);
prints

  • Option : C
  • Explanation :
    263 in binary form is 100000111.
    If one tries to print an integer as character, only the last 8 bits will be considered-the rest chopped off.
    So, in this case the ASCII value of 00000111 (i.e., decimal 7) will be printed. Look at the ASCII table. It is ringing a bell!
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 *