实验1.1 Visual C++2010 学习环境下, 在屏幕显示"hello world"
#include <stdio.h>
int main()
{
	printf("Hello, world!\n");
	system("pause");
	return 0;
}
实验1.3 建立第二个程序“add.c”并保存

即实现加法运算:

#include <stdio.h>
int main()
{
	int a, b, c;
	printf("Enter a, b= ");
	scanf("%d %d", &a, &b);
	c = a + b;
	printf("%d + %d = %d\n", a, b, c);
	system("pause");
	return 0;
}

更多推荐

实验一 熟悉C语言程序开发环境 → 张玉生《C语言程序设计实训教程》双色版 配套实验书答案 (纯手打, 仅供参考)