单项选择题

下面程序的输出结果是( )。 func(int X) { static int a=2; return (a+=X);} main() { int b=2,c=4,d; d=func(b); d=func(c); printf("%d\n",d); }

A.4
B.6
C.8
D.12
<上一题 目录 下一题>
热门 试题

单项选择题
若有如下程序: int s[3] [3]={'a','b','C','d','e','f','g','h','i'},*t; main() {t:(int*)malloc(sizeof(int)); sub(t,s); printf( %c n ,*t); } sub(int*p,int b[][3]) {*p=b[2][1]; } 则程序运行后的输出结果是( )。
A.d
B.e
C.h
D.b
单项选择题
若有如下程序: void a(char*p,char c) {while(*p) { if(*p==c)*p=c-'b'+'B';; p++; } } main() {char s[50]= abcdeeffgee ,b='e'; a(s,b);printf( %s n ,s); } 则程序运行后的输出结果是( )。
A.Abcdeeffgee
B.ABCDeeFFGee
C.abcdEEffgEE
D.ABCDEEFFGEE
相关试题
  • 有以下程序: #include<stdio.h> mai...
  • 有以下程序: #include <stdio.h> m...
  • 以下程序中函数f的功能是将n个字符串按由大...
  • 下列模式中,能够给出数据库物理存储结构与...
  • 若有如下程序: main() { int n=2...