English
Tamil Nadu Board of Secondary EducationHSC Science Class 11

Which of the following statement is valid? Why? Also, write their result. int a; a = (3,014); - Computer Science

Advertisements
Advertisements

Question

Which of the following statement is valid? Why? Also, write their result.

int a; a = (3,014);

One Line Answer

Solution

a = (3,014); – Valid. 014 is an octal constant. It will be converted into decimal and then stored in a. So, a will hold 12 as its value.

shaalaa.com
Sample program – A first look at C++ program
  Is there an error in this question or solution?
Chapter 9: Introduction to C++ - Data Types, Variables and Expressions - Evaluation - Section - B [Page 151]

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 10. (ii) | Page 151
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×