Can anybody tell me why this is happening in c language

前端 未结 3 1257
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-29 16:55
 #include 
 //Compiler version gcc 6.3.0

 int main(void)
 {

     float a=10;
    printf(\"%f\"+1,a);

    return 0;
 }

Output -- d

3条回答
  •  一向
    一向 (楼主)
    2021-01-29 17:25

    I am not sure what exactly are you trying to accomplish.

    If you want to do the sum, you just have to do it after the comma:

    from this:

    printf("%f"+36,a);
    

    to this:

    printf("%f",a+36);
    

    The same for the other sum.

提交回复
热议问题