APP下载
首页
>
IT互联网
>
信息技术知识竞赛c语言
搜索
信息技术知识竞赛c语言
题目内容
(
单选题
)
以下不正确的描述为()。

A、不同函数中可以使用相同名字的变量

B、形参是局部变量

C、一个函数内部定义的变量只能在本函数范围内有效

D、在一个内部的复合语句中定义的变量可以在本函数范围内有效

答案:D

信息技术知识竞赛c语言
下列变量定义中合法的是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4920-c089-2897e0346511.html
点击查看题目
若有以下程序段,输出结果是( )。
char s[ ]="\\141\141abc\t";
printf ("%d\n",strlen(s));
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e0346521.html
点击查看题目
若有数组定义: char array [ ]="China"; 则数组 array所占的空间为( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e034651e.html
点击查看题目
有以下程序
#include
#include
void fun(char *w,int m)
{char s,*p1,*p2;
p1=w;p2=w+m-1;
while(p1}
main()
{char a[]=”123456”;
fun(a,strlen(a)); puts(a);
}
程序运行后的输出结果是( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e0346514.html
点击查看题目
若有定义:int b[5];则以下对b 数组元素的正确引用是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e034651a.html
点击查看题目
有以下程序
#include "stdio.h"
void main()
{ int a=0,b=1,c=0,d=20;
if(a) d=d-10;
else if(!b)
if(!c) d=1;
else d=25;
printf("d=%d\n",d);
}
执行后的输出结果是( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6c48-c089-2897e034650a.html
点击查看题目
有以下程序
#include
void main()
{
int s,i,sum();
for (i=1;i<=10;i++)
s=sum(i);
printf("s=%d\n",s);
}
sum(int k)
{
int x=0;
return (x+=k);
}  
程序运行后的输出结果是 ( )。  
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e034650f.html
点击查看题目
有以下程序
  #include
  int fun()
  { static int x=1;
  x*=2;
  return x;
  }
  main()
  { int i,s=1;
  for(i=1;i<=3;i++) s*=fun();
  printf("%d\n",s);
  }
  程序运行后的输出结果是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e0346500.html
点击查看题目
有以下程序
#include
int fun()
{static int x=1;
x*=2; return x;
}
void main()
{int i,s=1;
for (i=1;i<=2;i++) s=fun();
printf("%d\n",s);
}
执行后的输出结果是( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e0346514.html
点击查看题目
要求通过while循环不断读入字符,当读入字母N时结束循环。若变量已正确定义,以下正确的程序段是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e0346526.html
点击查看题目
首页
>
IT互联网
>
信息技术知识竞赛c语言
题目内容
(
单选题
)
手机预览
信息技术知识竞赛c语言

以下不正确的描述为()。

A、不同函数中可以使用相同名字的变量

B、形参是局部变量

C、一个函数内部定义的变量只能在本函数范围内有效

D、在一个内部的复合语句中定义的变量可以在本函数范围内有效

答案:D

信息技术知识竞赛c语言
相关题目
下列变量定义中合法的是()。

A. short _a=1-.le-1;

B. double b=1+5e2.5;

C. long do=0xfdaL;

D. float 2_and=1-e-3;

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4920-c089-2897e0346511.html
点击查看答案
若有以下程序段,输出结果是( )。
char s[ ]="\\141\141abc\t";
printf ("%d\n",strlen(s));

A. 9

B. 12

C. 13

D. 14

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e0346521.html
点击查看答案
若有数组定义: char array [ ]="China"; 则数组 array所占的空间为( )。

A. 4个字节

B. 5个字节

C. 6个字节

D. 7个字节

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e034651e.html
点击查看答案
有以下程序
#include
#include
void fun(char *w,int m)
{char s,*p1,*p2;
p1=w;p2=w+m-1;
while(p1}
main()
{char a[]=”123456”;
fun(a,strlen(a)); puts(a);
}
程序运行后的输出结果是( )。

A. 654321

B. 116611

C. 161616

D. 123456

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e0346514.html
点击查看答案
若有定义:int b[5];则以下对b 数组元素的正确引用是()。

A. *b[5]

B. b+2

C. *(*(b+2))

D. *(b+2)

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e034651a.html
点击查看答案
有以下程序
#include "stdio.h"
void main()
{ int a=0,b=1,c=0,d=20;
if(a) d=d-10;
else if(!b)
if(!c) d=1;
else d=25;
printf("d=%d\n",d);
}
执行后的输出结果是( )。

A. d=10

B. d=15

C. d=20

D. d=25

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6c48-c089-2897e034650a.html
点击查看答案
有以下程序
#include
void main()
{
int s,i,sum();
for (i=1;i<=10;i++)
s=sum(i);
printf("s=%d\n",s);
}
sum(int k)
{
int x=0;
return (x+=k);
}  
程序运行后的输出结果是 ( )。  

A. 55

B. 45

C. 15

D. 10

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e034650f.html
点击查看答案
有以下程序
  #include
  int fun()
  { static int x=1;
  x*=2;
  return x;
  }
  main()
  { int i,s=1;
  for(i=1;i<=3;i++) s*=fun();
  printf("%d\n",s);
  }
  程序运行后的输出结果是()。

A. 0

B. 10

C. 30

D. 64

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e0346500.html
点击查看答案
有以下程序
#include
int fun()
{static int x=1;
x*=2; return x;
}
void main()
{int i,s=1;
for (i=1;i<=2;i++) s=fun();
printf("%d\n",s);
}
执行后的输出结果是( )。

A. 1

B. 2

C. 3

D. 4

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e0346514.html
点击查看答案
要求通过while循环不断读入字符,当读入字母N时结束循环。若变量已正确定义,以下正确的程序段是()。

A. while((ch=getchar())!="N")printf("%c",ch);

B. while(ch=getchar()!="N")printf("%c",ch);

C. while(ch=getchar()=="N")printf("%c",ch);

D. while((ch=getchar())=="N")printf("%c",ch);

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e0346526.html
点击查看答案
试题通小程序
试题通app下载