C语言编写一个小程序

C语言编写一个小程序随机产生一个数,然后再输入一个数,判点两数是否相等,相等输出true,否则输出false

#include <stdio.h>
#include <time.h>
int main()
{
int a,b;
srand(time(NULL));
a=rand();
scanf("%d",&b);
a==b?printf("true"):printf("false");
return 0;
}

//运行示例:

温馨提示:答案为网友推荐,仅供参考