填空题

下列程序的输出结果是【 】。 #include <stdio.h> void fun(int x) { if(x/2>0) fun(x/2); printf("%d",x); } main() { fun(3);printf("\n"); }

【参考答案】

M
<上一题 目录 下一题>
热门 试题

单项选择题
以下程序中函数f( )的功能是将n个字符串按由大到小的顺序进行排序。#include<string.h>void f(char p[ ][10],int n){ char t[20]; int i,j;for(i =O;i <n-1 ;i ++ )for(j =i + 1 ;j < n;j ++ )if(strcmp(p [i] ,p[j] ) <0){ strcpy(t,p[i]);strcpy(p[i] ,p[j] );strcpy(p[j] ,t); } }main ( ){ char p [ ] [ 10 ] = { abc , aabdfg , abbd , dcdbe , cd }; int i;f(p,5); printf( %d n ,strlen(p[O] ) );}程序运行后的输出结果是( )。
A.6
B.4
C.3
D.5
单项选择题
有以下程序:#include<stdlib.h>struct NODE{ int num;stmct NODE *next;};main( ) { struct NODE * p, * q,* r;p=(struct NODE * )malloc(sizeof(struct NODE) );q=(struct NODE * )malloc(sizeof(struct NODE) );r=(struct NODE * )malloc(sizeof(struct NODE) );p->num=10; q->num=20; r->num=30;p->next=q; q->next=r;printf( %d n ,p->num+q->next->num);}程序运行后的输出结果是( )。
A.10
B.20
C.30
D.40
相关试题
  • 执行以下程序后,输出’’#’’号的个数是...
  • 程序测试分为静态分析和动态测试。其中【 ...
  • 以下程序的功能是:利用指针指向三个整型变...
  • 以下程序的输出结果是【 】。#define MC...
  • 下列程序的运行结果是:【 】#include ...