Friday, 23 February 2018

C interview question 4

What will be the output of the given code?

#include <stdio.h>

void main()

{
  int a;

  a=9;

  a=printf("Dcoder")+printf("Blog");

  printf("%d",a);

}



Reason:
The return type of printf() is integer and which is being added and assigned to "a" then the value of a is displayed along with the previous outputs printf().

No comments:

Post a Comment

C interview question 8

What will be the output of the given code? #include <stdio.h> int main(void) { float a = 3.14; printf("%f",a%3); ...