Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1258011
  • 博文数量: 548
  • 博客积分: 7597
  • 博客等级: 少将
  • 技术积分: 4224
  • 用 户 组: 普通用户
  • 注册时间: 2010-12-15 13:21
个人简介

嵌入式软件工程师&&太极拳

文章分类

全部博文(548)

文章存档

2014年(10)

2013年(76)

2012年(175)

2011年(287)

7.c

分类:

2011-02-20 20:07:08

#include 

int main(void)
{
	printf("%d \n", 1+3);	//变量; 符号; 常量;关键字; 函数;
	int a = 12;
	int b = 24;
	int c = 36;

	printf("a + b = %d \n", a + b);
	printf("a - b = %d \n", a - b);
	printf("a * b = %d \n", a * b);
	printf("a / b = %d \n", a / b);
//	printf("a % c = %d \n", a % c);
//			  ^ 
//	printf("a%c = %d \n", a % c);
//			 ^ % %c: 
	printf("a %% c = %d \n", a % c);
	float f1 = 12.34;
	float f2 = 34.56;

	printf("f1 + f2 = %f \n", f1 + f2);
	printf("f1 - f2 = %f \n", f1 - f2);
	printf("f1 * f2 = %f \n", f1 * f2);
	printf("f1 / f2 = %f \n", f1 / f2);
//	printf("f1 %% f2 = %f \n", f1 % f2);实数不能%操作;

	return 0;
}
阅读(571) | 评论(0) | 转发(0) |
0

上一篇:6.c

下一篇:8.c

给主人留下些什么吧!~~