Literals in C++

Q2. What are literals in C++ ? How many types of literals are allowed in C++ ?

Ans. Literals mean constants that is, the data items that never change value during a program run.

C++ allows four types of literals:

1. Integer literal

2. Character literal

3. Floating Point literal

4. String literal

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s