0
点赞
收藏
分享

微信扫一扫

c语言学习打卡第四天

大师的学徒 2022-03-19 阅读 112

输入一个三位整数,并打印反序数s

#include<stdio.h>
int main()
{
	int a,b,c,d;
	a = 587;
	b = a/100;
	c = a%100/10;
	d = a%10;
	printf("%d%d%d",d,c,b);
 } 

输出结果为

785
--------------------------------
Process exited after 0.1539 seconds with return value 0
请按任意键继续. . .

使用sizeof表达式

#include<stdio.h>
int main()
{
	printf("char类型占%d字节",sizeof(char));
	printf("float类型占%d字节",sizeof(float));
 } 

结果为

char类型占1字节float类型占4字节
--------------------------------
Process exited after 0.1508 seconds with return value 0
请按任意键继续. . .
举报

相关推荐

0 条评论