题目内容

以下程序的功能是:将输入的正整数按逆序输出。例如:若输入 135 则输出 531 。请填空。
#include <stdio.h>
main()
{ int n,s;
printf("Enter a number : "); scanf("%d",&n);
printf("Output: ");
do
{ s=n%10; printf("%d",s); 【 10 】 ; }
while(n!=0);
printf("\n");
}

查看答案
更多问题

以下程序运行后的输出结果是 【 8 】 。
main()
{ int x,a=1,b=2,c=3,d=4;
x=(a<b)?a:b; x=(x<c)?x:c; x=(d>x) ? x : d;
printf("%d\n",x);
}

有以下程序
struct S {int n; int a[20];};
void f(struct S *P)
{ int i,j,t;
for(i=0;i<p->n-1;i++)
for(j=i+1;j<p->n;j++)
if(p->a[i]>p->a[j]) { t=p->a[i]; p->a[i]=p->a[j]; p->a[j]=t; }
}
main()
{ int i; struct S s={10,{2,3,1,6,8,7,5,4,10,9}};
f(&s);
for(i=0;i<s.n;i++) printf("%d",s.a[i]);
}
程序运行后的输出结果是

A. 1,2,3,4,5,6,7,8,9,10,
B. 10,9,8,7,6,5,4,3,2,1,
C. 2,3,1,6,8,7,5,4,10,9,
D. 10,9,8,7,6,1,2,3,4,5,

下面程序由两个源文件 t4.h 和 t4.c 组成,程序编译运行的结果是 【 18 】 。
t4.h 的源程序为:
#define N 10
#define f2(x) (x*N)
t4.c 的源程序为:
#include <stdio.h>
#define M 8
#define f(x) ((x)*M)
#include "t4.h"
main()
{ int i,j;
i=f(1+1); j=f2(1+1);
printf("%d %d\n",i,j);
}

以下合法的字符型常量是

A. "\x13"
B. "\018"
C. "65"
D. "\n"

答案查题题库