首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
下列程序的输出结果是( )。 #include<stdio.h> main() { int a=2,b=3,p; p=f(a,B) ; pdntf("%d",p); } int f(a,B) {
下列程序的输出结果是( )。 #include<stdio.h> main() { int a=2,b=3,p; p=f(a,B) ; pdntf("%d",p); } int f(a,B) {
admin
2010-09-05
23
问题
下列程序的输出结果是( )。
#include<stdio.h>
main()
{ int a=2,b=3,p;
p=f(a,B) ;
pdntf("%d",p);
}
int f(a,B)
{ int c;
if(a>B) c=1;
else if(a==B) c=0;
elSe c=-1;
return(C) ;
}
选项
A、-1
B、0
C、1
D、2
答案
A
解析
本题考查if else语句。在int f(a,b)中:第一个if语句,先判断条件,发现a>b条件不成立,则执行与其配对的else语句:第二个if语句,先判断条件,发现a==b条件不成立,则执行与其配对的else语句,c=-1。
转载请注明原文地址:https://kaotiyun.com/show/CeWp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
在关系代数运算中,有5种基本运算,它们是()。
设有如下关系表:则下列操作正确的是()。
关系数据模型
设R是一个2元关系,有3个元组,S是一个3元关系,有3个元组。如T=R×S,则T的元组的个数为()。
为把圆周率的近似值3.14159存放在变量pi中,应该把变量pi定义为( )。
(1)在考生文件夹下有一个工程文件sjt3.vbp,包含了所有控件和部分程序。程序运行时,在文本框中每输入一个字符,则立即判断:若是小写字母,则将它的大写形式显示在标签Label1中;若是大写字母,则把它的小写形式显示在Label1中,若是其他字符,则将该
深度为7的二叉树共有127个结点,则下列说法中错误的是
编写如下程序:PrivateSubCommand1_Click() Dimstr1AsString,str2AsString str1=InputBox("输入一个字符串") subfstr1,str2 Prints
编写如下程序:PrivateSubCommand1_Click() Dimstr1AsString,str2AsString str1=InputBox("输入一个字符串") subfstr1,str2 Prints
在软件工程中,白箱测试法可用于测试程序的内部结构。此方法将程序看做是()
随机试题
"Forestsarethelungsofourland,"saidFranklinDelanoRoosevelt.Twentyyearsago,theworld’slungswerediseased.Roughly
关于遮线器的作用,错误的是
女性,停经90天,近日阴道有少量不规则出血,小腹隐痛。妇检:子宫达脐,未能及胎体,B型超声子宫腔内为落雪状图像。则应考虑为
男性,58岁,搬运工人。站立或腹部用力时腹股沟突出肿块,卧位时或用手轻推则消失,并听到咕噜声,疑为腹股沟疝。下列哪项对鉴别斜疝和直疝最有意义()。
直接作用于体温调节中枢引起发热的是()。
一般法人申请金融期货开户时,要求净资产不低于人民币100万元。下列能作为净资产指标证明的有()。
在我国,宏观经济调控的基本手段包括( )。
临时导游证的有效期最长为()。
1856年首创转炉炼钢新技术的是()。
Ihavenoticedthatchildrenarenotevenbeingschoolinsocialgraces.AtaSundaybrunch,aclownwasmakingballoonanimals
最新回复
(
0
)