网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

17、对如下程序,若用户输入为A,则输出结果为() #include <stdio.h> int main() { char ch; scanf("%c",&ch); if(ch>=‘A’&&ch<=‘Z’) ch=ch+32; printf("%c",ch); return 0; }

A.A

B.32

C.a

D.空格


参考答案和解析
A 运算符“++”放在变量后面时,先参与其他操作,再对变量+1。putchar(C++)表示先输出当前C值,再对C值+1,当输入abcdef##时,在while语句中,程序输入“#”,循环退出。因此输出为abcdefg,答案为A选项。
更多 “17、对如下程序,若用户输入为A,则输出结果为() #include <stdio.h> int main() { char ch; scanf("%c",ch); if(ch>=‘A’ch<=‘Z’) ch=ch+32; printf("%c",ch); return 0; }A.AB.32C.aD.空格” 相关考题
考题 下列程序运行时,若输入labced12df回车 输出结果为【10】#include stdio.hmain( ){char a =0,ch;while((ch=getchar())!=’\n’){if(a2!=0(ch’a’ch=’z’)) ch=ch-‘a’+’A’;a++;putchar(ch);}printf(“\n”);}

考题 下列程序运行时 , 若输入 labcedf2df 回车 输出结果为【 1 0 】#include stdio.hmain(){ char a=0,ch;while((ch=getch ar ())!='\n'){ if(a%2!=0(ch='a'ch='z')) ch=ch-'a'+'A';a++; putchar(ch);}printf("\n");}

考题 下列程序的输出结果是______。 include include using namespace std; voi 下列程序的输出结果是______。include<iostream.h>include<string.h>using namespace std;void fun(const char*s,char C) {c=s[strlen(s)/2];}int main(){char str[]="ABCDE";char ch=str[1];fun(str,ch);cout<<ch;return 0;}

考题 下列程序的功能是:求出ss所指字符串中指定字符的个数,并返回此值。例如,若输入字符串123412132,输入字符1,则输出3,请填空。#include#include#define M 81int fun(char *ss, char c){ int i=0;for(; ( );ss++)if(*ss==c)i++;return i;}main(){ char a[M], ch;clrscr();printf("\nPlease enter a string: "); gets(a);printf("\nPlease enter a char: "); ch=getchar();printf("\nThe number of the char is: %d\n", fun(a,ch));}

考题 在执行以下程序时,如果从键盘上输入ABCdef,则输出为______。include main(){char 在执行以下程序时,如果从键盘上输入ABCdef<回车>,则输出为______。#include <stdio.h>main (){ char ch; while ((ch=getchar())!="\n") { if (ch>='A' ch<='B')ch=ch+32; else if (ch>='a' ch<='z')ch=ch-32; printf("%c",ch); } printf("\n");}A.ABCdefB.abcDEFC.abcD.DEF

考题 若输入12345、abc,程序的输出结果为______。 main() { int a; char ch; scanf("%3d,%3c",a,ch); printf("%d,%c",a,ch); }A.123,abcB.123,4C.123,aD.12345,abc

考题 有以下程序:includeunion pw{int i; char ch[2];}a;main(){a.ch[0]=13;a.ch[1]=0;prin 有以下程序: #include<stdio.h> union pw { int i; char ch[2]; }a; main() { a.ch[0]=13;a.ch[1]=0;printf("%d\n",a.i);} 程序的输出结果是( )。A.13B.14C.208D.209

考题 以下程序的输出结果是()。includecharcchar(chareh){if(ch>='A,ch 以下程序的输出结果是( )。 #include <stdio.h> charcchar(char eh) { if(ch>='A,ch<='Z') ch=ch-'A'+'a'; return ch; } main() { char s[]="ABC+abc=defDEF",*p=s; while(*p) { *p=cchsr(*p); p++; } printf("%s\n",s); }A.abc+ABC=DEFdefB.abc+abc=defdefC.abcABCDEFdefD.abcabcdefdef

考题 下列程序的输出结果是【】。 include include using namespace std; void fun(c 下列程序的输出结果是【 】。include<iostream>include<cstring>using namespace std;void fun(const char *s,char c){c=s[strlen(s)/2];}int main(){char str[]="ABCDE";char ch=str[1];fun(str,ch);cout<<ch;return 0;}

考题 下列程序运行时,若输入labcedf2df输出结果为【】。 include main(){char a=0,ch; wh 下列程序运行时,若输入labcedf2df<回车>输出结果为【 】。include<stdio.h>main(){ char a=0,ch;while((ch==getchar())!='\n'){ if(a%2!=0(ch>='a'ch<='z')) ch=ch'a'+'A';a++;prtchar(ch);}printf("\n");}

考题 若有如下程序: main() {int a=6;char ch=c; printf("%d\n",(a2)(ch<'m'));} 则程序运行后的输出结果是( )A.0B.1C.2D.3

考题 有如下程序includemain(){int v1=0,v2=0; char ch; while((ch=getchar())!='') switc 有如下程序 #include<stdio.h> main() { int v1=0,v2=0; char ch; while((ch=getchar())!='#') switch(ch) { case 'a'; casff 'h'; default:v1++; case '0';v2++; } printf("%d,%d\n",v1,v2); } 如果从键盘上输入china#<回车>,则程序运行结果为 ( )A.2,0B.5,0C.5,5D.2,5

考题 下列程序(注意:ch[0]在低字节,ch[1]在高字节)的输出结果是______。includeunion pw{int 下列程序(注意:ch[0]在低字节,ch[1]在高字节)的输出结果是______。#include<stdio.h>union pw{ int i;char ch[2];}a;main (){ a.ch[0]=13;a.ch[1]=0; printf("%d\n",a.i);}A.13B.14C.208D.209

考题 有以下程序: include include using namespace std; int main () {char ch[] 有以下程序:include <fstream>include <string>using namespace std;int main (){char ch[] = "The end";ofstream outstr( "d:\\put.txt", ios_base: :app);for (int i = 0; i < strlen( ch ); i++ )outstr.put(ch[i]);outstr.close();return 0;}程序实现的功能是【 】。

考题 以下程序运行后的输出结果是( )。 include main() {char ch[]="abcd",x[4][4];int i; f 以下程序运行后的输出结果是( )。 include<string.h> main() {char ch[]="abcd",x[4][4];int i; for(i=0;i<4;i++)strcpy(x[i],ch); for(i=0;i<4;i++)printf("%s",x[i][i]); printf("\n"); }

考题 运行下面程序时,从键盘输入字母H,则输出结果是includemain(){ char ch;ch=getchar();s 运行下面程序时,从键盘输入字母H,则输出结果是 #include<stdio.h> main() { char ch; ch=getchar(); switch(ch) { case 'H':printf("Hello!\n"); case 'G':printf("Good morning!\n"); default:printf("Bye_Bye!\n"); } }A.Hello!B.Hello! GoodMoring!C.Hello! Goodmorning! Bye_Bye!D.Hello! Bye_Bye!

考题 有以下程序#include stdio.hunion pw{ int i; char ch[2];}a;main(){ a.ch[0]=13;a.ch[1]=0; printf("%d\n",a.i);} 程序的输出结果是A.13 B.14C.0 D.20

考题 有以下程序: include main() {char ch1,ch2;int n1,n2;ch1=getchar();ch2=getehar();n1 有以下程序:include <stdio.h>main(){ char ch1,ch2;int n1,n2;ch1=getchar();ch2=getehar();n1=ch1-'0'; n2=n1*10+(ch2-'0');printf("%d\n",n2);}程序运行时输入:12<回车>,执行后的输出结果是【 】。

考题 下面程序中,若从键盘输入大写字母C,则程序的输出结果是______。 import java.io.*; public class Test{ public static void main(String args[ ]){ int ch=0; System.out.println("Please input a character:"); try{ ch=System.in.read( ); char ch_A='A',ch_Z='Z'; int delta_c=(int)ch_A+(int)ch_Z-ch; System.Out.println("the encoded character is:"+(char)delta_C); }catch(IOException e){e.printStackTrace( );} } }A.CB.YC.XD.字母C的ASCII码的整型值

考题 以下程序的输出结果是______。 char cchar(char ch) { if(ch>='A'ch<='z')ch=ch-'A'+'a'; return ch; } main() { char s[]="ABC+abc=defDEF",*p=s; while(* p) { * p=cchar(* p); p++; } printf("% s\n", s); }A.abe+ABC=DEFdefB.abc+abe=defdefC.abcaABCDEFdefD.abcabcdefdef

考题 下面程序的输出结果是______。includemain(){char ch[7]={"12ab56"}; int i,s=0; for(i 下面程序的输出结果是______。 #include<stdio.h> main() { char ch[7]={"12ab56"}; int i,s=0; for(i=0;ch[i]>='0'ch[i]<='9';i+=2) s=10*s+ch[i]-'0'; printf("%d\n",s); }A.1B.1256C.12ab56D.1 2 5 6

考题 有以下程序:includeunion pw{int i; char ch[2]; } a;main(){a.ch[0]=13; a.ch[1]=0; 有以下程序: #include <stdio.h> union pw { int i; char ch[2]; } a; main() { a.ch[0]=13; a.ch[1]=0; printf("%d\n",a.i); } 程序的输出结果是(注意:ch[0]在低字节,ch[1]在高字节)( )。A.13B.14C.208D.209

考题 在执行以下程序时,如果从键盘上输入:ABCdef,则输出为______。 main() { char ch; while((ch 在执行以下程序时,如果从键盘上输入:ABCdef<回车>,则输出为______。 main() { char ch; while((ch=getchar())!='\n') { if(ch>='A' ch<='Z') ch=ch+32; else if(ch>='a'ch<='2')ch=ch-32; printf("%c",ch); } printf("\n"); }A.ABCdefB.abcDEFC.abcD.DEF

考题 以下程序的输出结果是 char cchar(char ch) { if(ch>='A'ch<='Z') ch=ch-'A'+'a'; return ch; } main ( ) { char s [] = "ABC+abc=defDEF" , *p=s; while (*p) { *p=cchar(*p); p++; } printf { "%$\n", s); }A.abc+ABC=DEFdefB.abc+abc=defdefC.abcABCDEFdefD.abcabcdefdef

考题 有以下程序:#include stdio.hunion pw{ int i;char ch[2];}a;? main()? {a.ch[0]=13;a.ch[1]=0;printf( "%d\n",a.i);}程序的输出结果是A.13B.14C.208D.209

考题 单选题以下程序的输出结果是()      #include      union pw  {int i;char ch[2];}a;   main( )  {a.ch[0]=13;a.ch[1]=0;printf(”%d/n”,a.i);}      (注意:ch[0]在低字节,ch[1]在高字节。)A 13B 14C 208D 209

考题 单选题有如下程序:#include void get_put(){ char ch; ch=getchar(); if(ch!='')get_put(); putchar(ch);}main(){ get_put();}程序运行时,输入ABCD回车,则输出结果是(  )。A DCDCB DCBAC BABAD ABCD

考题 单选题有如下程序:#include void convert(char ch){ if(ch'D')convert(ch+1); printf(%c,ch);}main(){ convert('A'); printf(%);}程序运行后的输出结果是(  )。A ABCDDCBAB ABCDC AD DCBA