首页/ 题库 / [单选题]有以下定义#include <stdio的答案

有以下定义#include <stdio.h>char a[10],*b=a;不能给a数组输入字符串的语句是

单选题
2022-06-02 23:23
A、gets(A)
B、gets(a[0]);
C、gets(&a[0]);
D、gets(B) ;
查看答案

正确答案
B

试题解析
解析:函数gets()的调用形式为gets(str_adr);str_adr是存放字符串的起始地址。可以是字符数组名、字符指针或字符数组元素的地址。gets函数用来从终端键盘读入字符串(包括空格符),直到读入一个换行符为止。换行符读入后,不作为字符串的内容。本题中定义一个长度为10的字符数组,和一个指针变量b,并且通过赋值让它指向数组a。gets函数的参数a[0]不能表示数组a的首地址。

标签:
感兴趣题目
有以下程序:#include int fun(int a,int b){ if(b==0)return a; else return(fun(--a,--b));}main(){ printf(%d,fun(4,2));}程序运行的结果是(  )。
有以下程序: #include<stdio.h> main( ) { char a=H; a=(a>=Aa<=2)?(a-A+a):a; printf("%c ",a); } 程序运行后的输出结果是( )。
有以下程序 #include  char fun(char *c) {  if(*c<='Z'&&*c>='A')   *c-='A'-'a';  return *c; } main() {  char s[81],*p=s;  gets(s);  while(*p)  {   *p=fun(p);   putchar(*p);   p++;  }  printf(); } 若运行时从键盘上输入OPEN THE DOOR<回车>,程序的输出结果是(  )。
有以下定义: #include <stdio.h> char a[10],*b=a; 不能给数组a输入字符串的语句是( )。
有以下定义#include <stdio.h>char a[10],*b=a;不能给a数组输入字符串的语句是
有以下定义: #include <stdio.h> char a[10],*b=a; 不能给数组a输入字符串的语句是
下列程序的输出结果是( )。 #include<stdio.h> #include<string.h> main() { char a[]=" 123\"; printf("%d,%d ",strlen(a),sizeof(a)); }
有以下程序: #include <stdio. h> main( ) { unsigned int a; int b=-1; a=b; printf(" % u", a);程序运行后的输出结果是( )。
有以下程序 #include<stdio.h> void main() { int a=1,b=0; printf("%d,",b=(a++)+(a++)); pfintf("%d ",a+B); } 程序运行后的输出结果是( )。
有以下定义: # include<stdio.h> char a[l0],*b=a; 不能给a数组输入字符串的语句是 ______。
有以下定义: #include <stdio.h> char a[10], *b=a; 下面不能给数组a输入字符串的语句是( )。
以下程序的输出结果是( )。 #include <stdio.h> main() { int a=21,b=11; printf("%d ",--a+b,--b+a); }
相关题目
阅读下面程序段,则执行后输出的结果是
#include "stdio.h"
main()
{ char fun(char,int);
char a=′A′;
int b=13;
a=fun(a,b);
putchar(a);}
char fun(char a,int b)
{char k;
k=a+b;
return k;}
下面程序的运行结果是( )。 #include <stdio.h> main() { int a=1,b=10; do {b-=a;a++;}while(b--<0); printf("a=%d,b=%d ",a,b); }
有以下定义:char a[10],*p=a;不能给数组a输入字符串的语句是( )。
如有以下定义:static int a[10];static char b[10];float c[10];关于数组a,b,c中各元素的值,下列说法中不正确的是( )。
若有定义和语句:int a,b;
scanf("%d,%d,",&a,&B.;
以下选项中的输入数据,不能把值3赋给变量a、5赋给变量b的是
有以下程序 #include<stdio.h> main( ) {char a[3O],b[30]; scanf("%S",a); gets(b); printf("%s %s\n",a,b); } 程序运行时若输入: how are you? I am fine<回车> 则输出结果是( )。
有以下程序:#include <stdio.h>main( )} char a,b,e,d; seanf("% e,% e,% d,% d" ,&a,&b,&c,&d); printf("% c,% c,% e,% c " ,a,b,c,d);若运行时从键盘上输入:6,5,65,66 <回车>,则输出结果是( )。
以下程序段给数组所有元素输入数据:
#include<stdio.h>main()
{int a[10],i=0;
while(i<10)scanf(”%d”,);
}
应在下划线处填入的是(  )。
以下程序段给数组所有的元素输入数据,请选择正确答案填入。#include <stdio.h>main(){ int a[10],j=0; while(i<10)scanf("%d", ______ ); : :}
以下程序段给数组所有的元素输入数据,请选择正确答案填入。 #include<stdio.h> main() { int a[10],i=0; while(i<10)scanf("%d",______); : : }
以下程序段给数组所有的元素输入数据,请选择正确答案填入: #include<stdio.h> main() { int a[10],i=0; while(i<10)scanf("%d",______); : : }
以下程序调用scanf函数给变量a输入数值的方法是错误的,其错误原因是( )。 #include <stdio.h> main() { int *p,*q,a,b; p=&a; printf("input a:"); scanf("%d",*p); }
下述程序的输出结果是( )。 #include<stdio.h> void main() {char a=1,b=2; char c=a^b<<2; printf(" %d",C); }
下述程序的输出结果是( )。 #include<stdio.h> void main() {char a=3,b=1; char c=a^b<<2; printf("%d",C; }
已知:char a[15],b[15]={"I love china"};则在程序中能将字符串I love china赋给数组a的正确语句是
有以下程序:#include #include main(){ char a[20]=ab,b[20]=cdef; int k=0; strcat(a,b); while(a[k]!='\0') {  b[k]=a[k];  k++; } puts(b);}程序的运行结果是(  )。
有以下程序#include void  fun(char *a, char *b){ while(*a=='*') a++; while(*b=*a) {  b++;  a++; }}main(){ char *s=*****a*b**** , t[80]; fun(s,t); puts(t);}程序的运行结果是(  )。
有以下程序:#include#includemain(){ char w[20],a[5][10]={abcdef,ghijkl,mnopq,rstuv,wxyz.}; int i; for(i=0;i<5;i++)w[i]=a[i][strlen(a[i])-1]; w[5]='\0'; puts(w);}程序的运行结果是(  )。
有以下程序: #include  main() {  char a[30],b[30];  scanf(%s,a);  gets(b);  printf(%s%s,a,b); } 程序运行时若输入: how are you?I am fine<回车> 则输出结果是(  )。
有以下程序:#include main(){ int a=3; int b=3; printf(%d, a&b);}程序运行后的输出结果是(  )。
广告位招租WX:84302438

免费的网站请分享给朋友吧