condtest.c

来自「汇编经典教程profession_assembly_language(Richa」· C语言 代码 · 共 27 行

C
27
字号
/* condtest.c - An example of optimizing if-then code */#include <stdio.h>int conditiontest(int test1, int test2){        int result;        if (test1 > test2)        {                result = test1;        } else if (test1 < test2)        {                result = test2;        }else        {                result = 0;        }        return result;}int main(){        int data1 = 10;        int data2 = 30;        printf("The result is %d\n", conditiontest(data1, data2));        return 0;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?