主頁 > 教育培訓(xùn) > 計(jì)算機(jī)等級考試二級C語言考前密卷及答案(4)

計(jì)算機(jī)等級考試二級C語言考前密卷及答案(4)


(42) 以下程序的運(yùn)行結(jié)果是
    #include "stdio.h"
    main()
    {struct date
    {int year,month,day;}today;
    printf("%d\n",sizeof(struct date));
    }
    A)6
    B)8
    C)10
    D)12
(43)若有語句int *point,a=4;和 point=&a;下面均代表地址的一組選項(xiàng)是
    A)a,point,*&a
    B)&*a,&a,*point
    C)*&point,*point,&a
    D)&a,&*point,point
(44)在調(diào)用函數(shù)時(shí),如果實(shí)參是簡單的變量,它與對應(yīng)形參之間的數(shù)據(jù)傳遞方式是
    A)地址傳遞
    B)單向值傳遞
    C)由實(shí)參傳形參,再由形參傳實(shí)參
    D)傳遞方式由用戶指定
(45)已定義以下函數(shù)
    fun(char *p2, char *p1)
    {
    while((*p2=*p1)!='\0'){p1++;p2++;}
    }
    函數(shù)的功能是
    A)將p1所指字符串復(fù)制到p2所指內(nèi)存空間
    B)將p1所指字符串的地址賦給指針p2
    C)對p1和p2兩個指針?biāo)缸址M(jìn)行比較
    D)檢查p1和p2兩個指針?biāo)缸址惺欠裼?\0'
(46)若執(zhí)行下述程序時(shí),若從鍵盤輸入6和8時(shí),結(jié)果為
    main()
    {int a,b,s;
    scanf("%d%d",&a,&b);
    s=a
    if(a    s=b;
    s*=s;
    printf("%d",s);
    }                               
                                    
    A)36                           
    B)64                           
    C)48                           
    D)以上都不對                   
(47)fscanf函數(shù)的正確調(diào)用形式是                                    
    A)fscanf(fp,格式字符串,輸出表列);                            
    B)fscanf(格式字符串,輸出表列,fp);                            
    C)fscanf(格式字符串,文件指針,輸出表列);                      
    D)fscanf(文件指針,格式字符串,輸入表列);       
(48)下列關(guān)于C語言數(shù)據(jù)文件的敘述中正確的是                         
    A)文件由ASCII碼字符序列組成,C語言只能讀寫文本文件             
    B)文件由二進(jìn)制數(shù)據(jù)序列組成,C語言只能讀寫二進(jìn)制文件            
    C)文件由記錄序列組成,可按數(shù)據(jù)的存放形式分為二進(jìn)制文件和文本文件
    D)文件由數(shù)據(jù)流形式組成,可按數(shù)據(jù)的存放形式分為二進(jìn)制文件和文本文件
(49)有以下程序                                                    
    void ss(char *s,char t)                                       
    {while(*s)                                                    
    {if(*s= =t)*s=t-'a'+'A';                                      
    s++;                                                            
    }                                                               
    }                                                               
    main()                                                        
    {char str1[100]="abcddfefdbd",c='d';                          
    ss(str1,c); printf("%s\n",str1);                           
    }                                                               
    程序運(yùn)行后的輸出結(jié)果是                                          
    A)ABCDDEFEDBD                                                  
    B)abcDDfefDbD                                                  
    C)abcAAfefAbA                                                  
    D)Abcddfefdbd                                                  
(50)若以下定義:                                                   
    struct link                                                     
    {int data;                                                      
    struct link *next;                                              
    } a,b,c,*p,*q;                                                  
    且變量a和b之間已有如下圖所示的鏈表結(jié)構(gòu):                         
                                                                    
    指針p指向變量a,q指向變量c。則能夠把c插入到a和b 之間并形成新的鏈表的語句組是:
    A)a.next=c; c.next=b;                                          
    B)p.next=q; q.next=p.next;                                     
    C)p->next=&c; q->next=p->next;                                 
    D)(*p).next=q; (*q).next=&b

選擇題答案
01-05 C D B D D         
06-10 C D C C B     
11-15 C A B B B              
16-20 A B B B A              
21-25 C C A D B              
26-30 D B D B C               
31-35 A D C C A              
36-40 C A A A D              
41-45 C A B B A              
46-50 B D D B D

免責(zé)聲明:該文觀點(diǎn)僅代表作者本人,查查吧平臺系信息發(fā)布平臺,僅提供信息存儲空間服務(wù),不承擔(dān)相關(guān)法律責(zé)任。圖片涉及侵權(quán)行為,請發(fā)送郵件至85868317@qq.com舉報(bào),一經(jīng)查實(shí),本站將立刻刪除。返回查查吧首頁,查看更多>>
提示

該文觀點(diǎn)僅代表作者本人,查查吧平臺系信息發(fā)布平臺,僅提供信息存儲空間服務(wù),不承擔(dān)相關(guān)法律責(zé)任。圖片涉及侵權(quán)行為,請發(fā)送郵件至85868317@qq.com舉報(bào),一經(jīng)查實(shí),本站將立刻刪除。

優(yōu)惠商城

更多