Use app×
QUIZARD
QUIZARD
JEE MAIN 2026 Crash Course
NEET 2026 Crash Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
162 views
in Getting Started with C++ by (30.8k points)
closed by

We know that the value of pi=3.14157, a constant (literal). What is a constant? Explain it?

1 Answer

+1 vote
by (33.0k points)
selected by
 
Best answer

A constant or a literal is a data item its value doe not change during execution. 

1) Integer literals: Whole numbers without fractional parts are known as integer literals, its value does not change during execution. There are 3 types decimal, octal and hexadecimal. 

Eg. For decimal 100,150,etc 

For octal 0100, (5240, etc For hexadecimal 0x100, 0x1A,etc 

2) Float literals: A number with fractional parts and its value does not change during execution is called floating point literals. 

Eg. 3,14157,79.78,etc 

3) Character literal: A valid C++ character enclosed in single

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

...