温馨提示×

c语言怎么输出一段字符串

小亿
122
2023-11-23 22:28:41
栏目: 编程语言

在C语言中,要输出一段字符串,可以使用printf函数来实现。

例如,要输出字符串"Hello World!",可以使用以下代码:

#include <stdio.h>

int main() {
    printf("Hello World!");
    return 0;
}

运行程序,输出结果为:

Hello World!

在printf函数中,使用双引号括起来的内容表示字符串。要输出具体的字符串内容,只需要将字符串放在printf函数的括号内即可。

0