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";
A: char ch = 65;
B: char ch = ’¥65’;
C: char ch = ’¥0041’;
D: char ch = ’A’;
E: char ch = "A";
举一反三
- 【单选题】下面定义字符型变量ch的语句不正确的是()。 A. char ch=‘X2A’; B. char ch="c"; C. char ch=65; D. char ch=NULL;
- 关于字符型变量的定义正确的是( ) A: char ch=a; B: char ch=’a’; C: char ch=”a”; D: char ch=\a;
- 下列哪条语句是正确的( )。 A: char ch[4]="Andy"; B: char ch="Andy"; C: char ch[5];ch[5]="Andy"; D: char ch[5]="Andy";
- 下列变量定义中,正确的是() A: char<br/>ch =“A”; B: char<br/>ch =‘好’; C: char<br/>ch =“好”; D: char<br/>ch =12;
- 下列选项中,()是正确的char变量的声明A. char ch="R"; B. char ch='\\' ; C. char ch='ABCD'; D. char ch="ABCD"; A: A B: B C: C D: D