![](https://img.examw.com/index/logo.png)
二、填空題(本大題共10小題,每小題2分,共20分)
11.設(shè)int n=11;,表達(dá)式n%5+n%7的值是_______。
12.執(zhí)行語(yǔ)句printf("%d\n", 8>>2);后的輸出結(jié)果是_______。
13.設(shè)char s[10]= "Olympic";,執(zhí)行語(yǔ)句printf("%d\n",sizeof(s));后輸出結(jié)果是_______。
14.三種邏輯運(yùn)算符的優(yōu)先級(jí)又高到低依次是_______。
15.設(shè)float m=8.8; int n=6;,執(zhí)行語(yǔ)句printf("%d\n", (int)m+n);后輸出結(jié)果是_______。
16.設(shè)struct { int a; float b; } c, *p=&c;,用指針引用成員b的方式是p->b或_______。
17.設(shè)int p=1,q=2,r=3;,表達(dá)式p>q< p>
18.系統(tǒng)函數(shù)int rewind(FILE *fp)的功能是_______。
19.函數(shù)調(diào)用時(shí)參數(shù)傳遞方式除地址傳遞外,還有_______。
110.使用系統(tǒng)函數(shù)getchar( )和putchar( )時(shí),用到的文件包含命令縣_______。
三、程序分析題(本大題共4小題。每小題4分,共16分)閱讀下列程序,寫(xiě)出輸出結(jié)果。
21.#include void main(){ int j; char *color[]={"red", "yellow", "blue", "black", "white"}; for( j=0; j<5; j+=2) printf("%s\n", color[j]);}
22.#include void main(){ int i=10, j=0; switch (i%3) { case 0: i--; j++; case 1: --i; ++j; break; default: ++i; j--; } printf("i=%d, j=%d\n", i, j);}
23.#include int i=1;int fun(int j){ return (++i+j);}void main(){ int j; for(j=1; j<=3; j++) printf("%d\n", fun(j));}
24.#include void main(){ int i; char *strp="****"; for(i=0; i<4; i++) printf("%s\n", strp+i);}
四、程序填充題(本大題共3小題,每小題6分,共18分)
31.計(jì)算某學(xué)生三門(mén)課的平均成績(jī)并輸出。#include typedef struct student{ char name[20]; float math, physics, chemistry, average;}_______; /*第一空*/void main(){ STU s={"ZhangSan", 88.5, 90.0, 73.0}; s.average=_______; /*第二空*/ printf("平均成績(jī)=%.1f\n",_______); /*第三空*/}
32.鍵入一串字符,以回車(chē)換行符為結(jié)束標(biāo)志,統(tǒng)計(jì)并輸出其中小寫(xiě)英文字母的個(gè)數(shù)。#include void main(){ char letter; int sum=_______; /*第一空*/ while((letter=getchar())!='\n') if(_______) sum++; /*第二空*/ printf("小寫(xiě)英文字母?jìng)(gè)數(shù)sum=%d\n",_______); /*第三空*/}
33.從鍵盤(pán)為二維整型數(shù)組a輸入數(shù)據(jù),輸出該二維數(shù)組的轉(zhuǎn)置b。#include #define M 2#define N 3void main(){ int a[M][N], b[N][M], i, j; printf("二維數(shù)組a:\n"); for(i-0; i< printf(?\n?); j++)printf(?%5d?,b[i][j]); i
五、程序設(shè)計(jì)題(本大題共2小題,每小題8分。共16分)
41.從鍵盤(pán)輸入一串字符(以#作為結(jié)束標(biāo)志)顯示到屏幕上并寫(xiě)入文本文件ch.txt。
42.(1)編寫(xiě)函數(shù)f計(jì)算
的值。(2)編寫(xiě)主函數(shù),從鍵盤(pán)輸入x和n的值,調(diào)用函數(shù)f計(jì)算并輸出結(jié)果(保留兩位小數(shù))。
更多自考模擬試題、筆記串講、歷年真題等復(fù)習(xí)資料請(qǐng)進(jìn)華課網(wǎng)校自考頻道獲取…………
編輯提醒:
自考問(wèn)答熱點(diǎn)答疑專題 自考備考熱點(diǎn)及其技巧匯總
想要給自己一個(gè)提升學(xué)歷的機(jī)會(huì),不知道如何選擇院校及專業(yè)、自考、成考當(dāng)?shù)卣卟涣私?點(diǎn)擊加入學(xué)歷提升群:811430100,立即報(bào)考咨詢,更快提升學(xué)歷 ,不用去學(xué)校,就能修名校?/本科學(xué)歷,國(guó)家承認(rèn),簡(jiǎn)單易考,高含金量,學(xué)信網(wǎng)終身可查!!
手機(jī)QQ掃碼一鍵加群