以下是yjbys考試網小編搜尋整理的全國計算機等級考試二級C語言筆試填空真題,更多計算機二級考試請繼續關注應屆畢業生考試網。
填空題(每空2分,共30分)
(1)某二叉樹有5個度為2的結點以及3個度為1的結點,則該二叉樹中共有【1】 個結點。
(2)程式流程圖中的菱形框表示的是 【2】 。
(3)軟體開發過程主要分為需求分析、設計、編碼與測試四個階段,其中 【3】 階段產生“軟體需求規格說明書。
(4)在資料庫技術中,實體集之間的聯絡可以是一對一或一對多或多對多的,那麼“學生”和“可選課程”的聯絡為 【4】 。
(5)人員基本資訊一般包括:身份證號,姓名,性別,年齡等。其中可以作為主關鍵字的是 【5】 。
(6)若有定義語句:int a=5;,則表示式:a++的值是 【6】 。
(7)若有語句double x=17;int y;,當執行y=(int)(x/5)%2;之後y的`值為 【7】 。
(8)以下程式執行後的輸出結果是 【8】 。
#include
main()
{ int x=20;
printf(“%d”,0
printf(“%dn”,0
(9)以下程式執行後的輸出結果是 【9】 。
#include
main()
{ int a=1,b=7;
do {
b=b/2;a+=b;
} while (b>1);
printf(“%dn”,a);}
(10)有以下程式
#include
main()
{ int f,f1,f2,i;
f1=0;f2=1;
printf(“%d %d”,f1,f2);
for(i=3;i<=5;i++)
{ f=f1+f2; printf(“%d”,f);
f1=f2; f2=f;
}
printf(“n”);
}
程式執行後的輸出結果是 【10】 。
(11)有以下程式
#include
int a=5;
void fun(int b)
{ int a=10;
a+=b;printf(“%d”,a);
}
main()
{ int c=20;
fun(c);a+=c;printf(“%dn”,a);
}
程式執行後的輸出結果是 【11】 。
(12)設有定義:
struct person
{ int ID;char name[12];}p;
請將scanf(“%d”, 【12】 );語句補充完整,使其能夠為結構體變數p的成員ID正確讀入資料。
(13)有以下程式
#include
main()
{ char a[20]=”How are you?”,b[20];
scanf(“%s”,b);printf(“%s %sn”,a,b);
}
程式執行時從鍵盤輸入:How are you?<回車>
則輸出結果為 【13】 。
(14)有以下程式
#include
typedef struct
{ int num;double s}REC;
void fun1( REC x ){=23;x.s=88.5;}
main()
{ REC a={16,90.0 };
fun1(a);
printf(“%dn”,);
}
程式執行後的輸出結果是 【14】 。
(15)有以下程式
#include
fun(int x)
{ if(x/2>0) run(x/2);
printf(“%d ”,x);
}
main()
{ fun(6);printf(“n”); }
程式執行後的輸出結果是 【15】 。