顺序结构2

作者: 时间:2020-07-10 点击数:

数据类型:
   数学:整数、实数、字符
c语言:基本数据类型、复合数据类型(结构体、枚举、共用体等)
基本数据类型:整数、浮点数、字符
整数:
     整型:int     4个字节
  短整型:short int    2个字节
  长整型:long int   8个字节
   浮点数:
     单精度浮点数   双精度浮点数
   float           double
   4个字节          8个字节

3.3:   3.3    3.3000000001    3.29999999999
浮点数存储:存储的不一定是数据本身,有可能是无限接近这个数一个数。
    float x;   x=5.0;     floor()取整函数
       floor(x):   5,4        floor(x+0.5):一定是x的整数部分    
字符:
      char    1个字节
   char i='b';

#include <stdio.h>
int main(){
int i=10.6;//表示定义一个名称叫i的整型变量,i就能存放任意一个整数,不能存储浮点数
float j=3.3;
char k='A';
printf("%d\n",i); printf("%f\n",j); printf("%c\n",k); return 0;}

上一页 [1] [2] [3] 下一页

Copyright© 2020 Anyang Institute of Technology.All rights reserved.

学院地址:河南省安阳市黄河大道西段