首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
以下程序的功能是:将输入的正整数按逆序输出。例如:若输入135则输出531。请填空。 #include main() { int n,s; printf("Enter a number : "); scanf("%d",&n); prin
以下程序的功能是:将输入的正整数按逆序输出。例如:若输入135则输出531。请填空。 #include main() { int n,s; printf("Enter a number : "); scanf("%d",&n); prin
admin
2010-12-10
20
问题
以下程序的功能是:将输入的正整数按逆序输出。例如:若输入135则输出531。请填空。
#include
main()
{ int n,s;
printf("Enter a number : "); scanf("%d",&n);
printf("Output: ");
do
{ s=n%10; printf("%d",s);【 】;
}while(n!=0);
printf("\n");
}
选项
答案
n/=10或n=n/10
解析
每次循环把n除以10所得的商赋给n。
转载请注明原文地址:https://jikaoti.com/ti/VTB0FFFM
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
已知变量x、y为整数型,且x=4,y=12,s为字符串型,且s=a,LblOk为标签控件,下列赋值语句不合法的是()。
求1!+2!+……+10!的程序如下:PrivateFunctions(xAsInteger) f=1 Fori=1Toxf=f*i Next s=fEndFunctionPrivateSubCommand1
以下过程的功能是从数组中寻找最大值:PrivateSubFindMax(a()AsInteger,ByRefMaxAsInteger) DimsAsInteger,fAsInteger DimiAsInteger
数据库设计过程不包括()。
结构化程序设计中,下面对goto语句使用描述正确的是
下列叙述中正确的是
下列选项中,不属于数据管理员(DBA)职责的是()。
在数据库的三级模式结构中,描述数据库中全体数据的全局逻辑结构和特征的是()。
设窗体上有一个名称为List1的列表框,并有若干列表项。下面语句中不能在所有列表项之后追加一个列表项的是
VisualBasic控件一般都规定一个默认属性,在引用这样的属性时,只写对象名而不必给出属性名。默认属性为Caption的控件是( )。
随机试题
Someadultsspendalotoftimetryingtostopchildrenplaying.Theyareusuallypeoplewhothinkofplayasthe【C1】______ofwo
A、高热骤降,涕泪横流,两目红赤B、高热不退,咳嗽气促,鼻煽痰鸣C、壮热起伏,烦躁不安,咳嗽阵作D、高热不退,烦躁谵妄,四肢抽搐E、咽喉肿痛,咳声重浊,声如犬吠麻疹邪毒闭肺证在麻疹的基础上证见
贯穿于土石坝施工的各个环节和施工全过程的是()。
施工企业组织生产、编制施工计划、签发任务书的依据是( )。
审计人员在确定应收账款函证的范围和对象时,需要考虑的因素有()。
赵、钱、孙、李设立一家普通合伙企业。经全体合伙人会议决定,委托赵与钱执行合伙事务,对外代表合伙企业。对此,下列表述错误的是()。
价值规律决定商品的价值量是由()劳动时间决定的。
甲公司于2012年1月1日以货币资金1000万元取得了乙公司10%的股权,甲公司将取得乙公司10%股权作为可供出售金融资产核算。2012年12月31日,该可供出售金融资产的公允价值为1200万元。乙公司于2012年度实现净利润1000万元。宣告并支付现金股
下列句子与其他三项句式特点不同的是()。
在如图4一16所示的数据流图中,共存在(29)个错误。
最新回复
(
0
)