填空题

以下程序运行后的输出结果是【 】   fun(int x)   { if(x/2>0) fun(x/2);    printf("%d ",x);   }   main( )   { fun(6); }

【参考答案】

1 3 6
<上一题 目录 下一题>
热门 试题

填空题
函数strcmp( )的功能是对两个字符串进行比较,当s所指字符串和t所指字符串相等时,返回值为0; 当s所指字符串大于t所指字符串时,返回值大于0;当s所指字符串小于t所指字符串时,返回值小于0(功能等同于库函数strcmp( ) ),请填空。#include <stdio.h>int strcmp ( chat * s, char * t){ while( * s && * t && * s=【 】{ s++;t++; }return【 】;)
填空题
下面程序的功能是建立一个有3个结点的单循环链表,然后求各个结点数值域data中数据的和,请填空。#include #include struct NODE{ int data;struct NODE*next;} ;main(){struct NODE *P,*q,*r;int sum=0;P=(struct NODE*)malloc(sizeof(struct NODE));q=(struct NODE*)malloc(sizeof(struct NODE));r=(struct NODE*)malloc(sizeof(struct NODE));P->data=100; q->data=1200; r->data=300;P->next=q; q->next=r; r->next=P;sum=P->data+P->next->date+r->next->next【 】;printf( %d\n ,sum);}
相关试题
  • 现有两个C程序文件T18.C和myfun.C同在T...
  • 已有文本文件test.txt,其中的内容为:Hel...
  • 以下程序中,for循环体执行的次数是【 】...