C 练习实例50

C语言教程评论

C 练习实例50

题目:#include 的应用练习。

程序分析:无。文章源自公式库网-https://www.gongshiku.com/html/202112/c-lianxishili50.html

test.h 文件代码如下:文章源自公式库网-https://www.gongshiku.com/html/202112/c-lianxishili50.html

#define LAG >
#define SMA <
#define EQ ==

主文件代码:文章源自公式库网-https://www.gongshiku.com/html/202112/c-lianxishili50.html

#include "test.h"  
#include <stdio.h>

int main()
{
    int i=10;
    int j=20;
    if(i LAG j)
        printf("%d 大于 %d \n",i,j);
    else if(i EQ j)
        printf("%d 等于 %d \n",i,j);
    else if(i SMA j)
        printf("%d 小于 %d \n",i,j);
    else
        printf("没有值。\n");
    return 0;
}

以上实例输出结果为:文章源自公式库网-https://www.gongshiku.com/html/202112/c-lianxishili50.html

10 小于 20
文章源自公式库网-https://www.gongshiku.com/html/202112/c-lianxishili50.html文章源自公式库网-https://www.gongshiku.com/html/202112/c-lianxishili50.html
运营不易,
感谢支持!
weinxin
我的微信
我的微信公众号
我的微信公众号扫一扫
weinxin
我的公众号
 最后更新:2021-12-7
公式库网
  • 本文由 公式库网 发表于 2021年12月6日20:38:05
  • 转载请务必保留本文链接:https://www.gongshiku.com/html/202112/c-lianxishili50.html

发表评论