网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
The 8859-1 character code for the uppercase letter A is 65. Which of these code fragments declare and initialize a variable of type char with this value?()
- A、char ch = 65;
- B、char ch = ’¥65’;
- C、char ch = ’¥0041’;
- D、char ch = ’A’;
- E、char ch = "A";
参考答案
更多 “The 8859-1 character code for the uppercase letter A is 65. Which of these code fragments declare and initialize a variable of type char with this value?() A、char ch = 65;B、char ch = ’¥65’;C、char ch = ’¥0041’;D、char ch = ’A’;E、char ch = "A";” 相关考题
考题
下列程序的输出结果是______。 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;}
考题
下列程序从标准输入设备——键盘读入一个字符,然后再输出到屏幕。要想完成此功能,画线处应该填入的语句为( )。 import java.io.*; public class Test { public static void main(String args[]) { char ch; try { ______; System.out.println(ch); } catch(IOException e) { e.printStackTrace(); } } }A.ch=System.in.read();B.ch=(char)System.in.read();C.ch=(char)System.in.readln();D.ch=(int)System.in.read();
考题
下列程序段中,不能正确赋值的是( )。A.char*p,ch; p=Ch; scanf("%c",p);B.char*p; p=char*)malloc(1); scanf("%c",p);C.char*p; *p=getchar();D.char*p,ch; p=ch; *p=getchar();
考题
下列程序的功能是:求出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));}
考题
下列字符数组的初始化,正确的是( )。A.char ch[5]={"a","b","c","d","e"};B.char ch[]={'a','b'};C.char ch[15]={"welcome to china"};D.char ch[14]={"I am a student"};
考题
在执行以下程序时,如果从键盘上输入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
考题
下列程序的功能是:求出ss字符串中指定字符c的个数,并返回此值。请编写函数int num(*char ss,char c)以实现程序要求,最后调用函数readwriteDat(),把结果输出到文件out.dat中(注:大小写字母有区别)。例如:若输入字符串“ss="123412132" , c=’1’”,则输出“3”。部分源程序已给出。请勿改动主函数main()和输出数据函数writeDat()的内容。#include conio.h#include stdio.h#define M 81void readwriteDAT(); int num(char *ss,char c){ } 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" ,num(a,ch)); readwriteDAT();}viod readwriteDAT(){ int i; FILE *rf,*wf; char a[M],b[M],ch; rf=fopen("in.dat" ,"r" ); wf=fopen(" out.dat" ,"w" ); for(i=0;i10;i++){ fscanf(rf," %s",a); fscanf(rf," %s" ,b); ch=*b; fprintf(wf," %c=%d\n:" ,ch,num(a,ch));} fclose(rf); fclose(wf);}
考题
下列对结构及其变量定义错误的是( )。A.struct My StructB.struct MyStruct{ {int num; int num;char ch; char ch;} }My;C.strutD.struct{ {int num; int num;char ch; char ch;}My; };
考题
下列程序的输出结果是【】。 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");}
考题
下列程序段中,不能正确赋值的是A.char*p,ch; p=ch; scanf("%c,p")B.char*p; p=(char*)malloc(1); scanf("%c",p);C.char*p; *p=getchar();D.char*p,ch; p=缸h; *p=getchar();
考题
下面程序中,若从键盘输入大写字母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
考题
若有char ch[10],则下列字符串数组的赋值中不正确的是( )。A.ch="welcome";B.ch[0]='w';C.strcpy(ch,"welcome");D.char ch1[]="welcome";strcpy(ch,ch1);
考题
在执行以下程序时,如果从键盘上输入: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
考题
下列对结构及其变量定义错误的是( )。A.struct My Struct { int num; char ch; }B.struct MyStruct { int num; char ch; }My;C.strut { int num; char ch; }My;D.struct { int num; char ch; };
考题
以下程序的输出结果是 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
考题
下列选项中,能有效声明一个字符的语句有()。A、char ch=’a’;B、char ch=’/’’;C、char ch=’cafe’;D、char ch="cafe";E、char ch=’/ucafe’;F、char ch=’/u10100’;G、char ch=(char)true;
考题
判断char型变量ch是否为小写字母的正确表达式是()A、’a’=ch=’z’B、(ch=’a’)(ch=’z’)C、(ch=’a’)(ch=’z’)D、(’a’=ch)AND(’z’=ch)
考题
Which two are valid declarations of char?()A、 Char ch = “a”;B、 char ch = “”;C、 char ch = “café”;D、 char ch = “ucafe”;E、 char ch = “ucafe’;F、 char ch = “u10100’;G、 char ch = (char) true;
考题
多选题The 8859-1 character code for the uppercase letter A is 65. Which of these code fragments declare and initialize a variable of type char with this value?()Achar ch = 65;Bchar ch = ’¥65’;Cchar ch = ’¥0041’;Dchar ch = ’A’;Echar ch = A;
考题
多选题Which two valid declarations of a char?()AChar ch = “a”;BChar ch = ‘/’ ‘;CChar ch = ‘cafe’;DChar ch = “cafe”;EChar ch = ‘/ucafe’;FChar ch = ‘/u10100’;GChar ch = (char) true;
热门标签
最新试卷