English
Tamil Nadu Board of Secondary EducationHSC Science Class 11

Consider the following C++ statement. Are they equivalent? char ch = 67; char ch = ‘C’; - Computer Science

Advertisements
Advertisements

Question

Consider the following C++ statement. Are they equivalent?

char ch = 67;

char ch = ‘C’;

Short Note

Solution

Both the statements are equivalent as they declare ‘ch’ to be char and initialize it with the value of 67. Since this is the ASCII code for ‘C’, the character constant also can be used to initialize ‘ch’ to 67.

shaalaa.com
Lexical Units (Tokens)
  Is there an error in this question or solution?
Chapter 9: Introduction to C++ - Data Types, Variables and Expressions - Evaluation - Section - B [Page 150]

APPEARS IN

Samacheer Kalvi Computer Science [English] Class 11 TN Board
Chapter 9 Introduction to C++
Data Types, Variables and Expressions - Evaluation - Section - B | Q 5. | Page 150
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×