C语言基本结构
简单的C语言示例
【例一】编写一个程序,输出指定的信息
程序如下:
#include<stdio.h> stdio.h
main()
{
printf(“Hello World!\n”);
}
#include<stdio.h> //编译预处理命令,表示包含标准输入输出的头文件stdio.h
main() //C语言有且仅有的main函数
{ //“{}”中为函数体
printf(“Hello World!\n”); //调用printf()函数来输出指定的信息。printf函数为标准的输入输出stdio.h中的函数
}
结果如下:![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/f0c7cb0b5234000d9bb1bb6c9271ec9d.png)