C中的printf()函数

时间:2017-08-24 00:17:32

标签: c printf

我不敢相信我被困在这里,但我似乎无法克服这一点。 我想在句子的中间放一个long整数。

我得到了这个输出;

Howdy, I am 166662
Process returned 0 (0x0)   execution time : 0.019 s
Press any key to continue

我正在使用代码块来运行它。

#include <stdio.h>

int main(){
  long mn = 166662;
  printf("Howdy, I am %ld",mn,"i hope that you had a better better day than I  having.\n");
  return 0;
}

1 个答案:

答案 0 :(得分:3)

阅读printf规范:首先是格式字符串,然后是参数。

#include <stdio.h>

int main(){
    long mn = 166662;
    printf("Howdy, I am %ld i hope that you had a better better day than I am having.\n", mn );
    return 0;
}