C语言学习笔记:数据类型转换,运算符分类,变量数值的转换与四种占位符的使用

数据类型转换:
自动转换:低精度转为高精度自动转换(不四舍五入)
强制转换:高精度转为低精度强制转换(丢失精度)
数据类型大小排序:
char >short>int >long >float>double
接收用户输入数据:scanf("%d",&num1);
运算符分类:
算术运算符,比较运算符,赋值运算符逻辑运算符
算术运算符:+ - * / %(取余)
%:余数
#include <stdio.h>
int main(){
int a=10;
int b=20;
int c;
c=b;
b=a;
a=c;
printf("a=%d,b=%d",a,b);
return 0;
}
int 用%d char用%c float用%f char[ ]用%s