zoukankan      html  css  js  c++  java
  • 10.15实验课作业

    #include<stdio.h>
    int main(){
        printf("my mul is:202083290296
    ");
        printf("hello 2020");
        return 0;
    }

    #include<stdio.h>
    int main (){
        while(1)
        printf("0 1 ");
        return 0;
    }

    #include<stdio.h>
    int main(){
        float x,y;
        float a,b,c,e;
        x=1;
        y=2;
        a=x+y;
        b=x-y;
        c=x*y;
        e=x/y;
        printf("a=%f
    ",a);
        printf("b=%f
    ",b);
        printf("c=%f
    ",c);
        printf("e=%f
    ",e);
        return 0;
    }
    #include<stdio.h>
    int main(){
        float x;
        int y;
        float a,b,c,e;
        x=1;
        y=2;
        a=x+y;
        b=x-y;
        c=x*y;
        e=x/y;
        printf("a=%f
    ",a);
        printf("b=%f
    ",b);
        printf("c=%f
    ",c);
        printf("e=%f
    ",e);
        return 0;
    }

    实验报告:

    1每句编程语言结束一定要打“;”!!!

    2正确的标点符合和关键字系统会用不同颜色显示,方便检查。

    3c语言中的除法,如果除数与被除数都为int则商为int, 所以在第三个试验中当x与y被定义为int,e被定义为float时结果为0,因此为了使e得到正确结果x,y都需要为float.

    百度资料:当除数和被除数为int时,商为int。当除数与被除数有一个为float 时商为float.所以实验三中插入的两个代码都可以得出上图结果。

  • 相关阅读:
    xampp+vscode开发php的配置流程
    如何开始学习以太坊及区块链
    java动态生成带下拉框的Excel导入模板
    汉字转拼音
    Git+Gradle+Eclipse构建项目
    test
    MacOS这idea快捷键
    HashMap扩容全过程
    NIO理解
    详解MySQL 内连接、外连接、左连接、右连接
  • 原文地址:https://www.cnblogs.com/2967271912lala/p/13823852.html
Copyright © 2011-2022 走看看