C语言学习笔记一

/*  HELLO.C -- Hello, world */

#include "stdio.h"
#include "conio.h"

main()
{
    float x = 3.2e10;
    char a = 'a';   /*注意对字符的赋值是单引号*/
    unsigned n;
    int m;
    int i = 10;
    /*枚举类型是给每个元素从0到n来给每个元素赋值的,打印出来的东西是整形的
    枚举类型的使用本身是为了某些逻辑结构的运算*/
    enum day {Monday,Tuesday,Wednesday,Thursday,Friday,Sunday,Saturday};
    enum day fir_day,end_day;
    fir_day = Tuesday;
    end_day = Sunday;

    printf("%d\n",fir_day);

    printf("char a = %d\n",a);
    printf("char a = %c\n",a);
    printf("Hello, world%10.5f\n",x);
    /*-------注意C语言中变量的声明放在首部----------------------*/
    ?*从键盘输入数据,注意取的是变量的地址*/
      scanf("%d",&m);
      printf("Input word is %d",m);

    n = i;
    printf("%d\n",n);
    getch();
}

你可能感兴趣的:(C语言学习笔记)