c语言学习打卡第四天

阅读 112

2022-03-19

输入一个三位整数,并打印反序数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)

0 0 举报