What are Literals

What are Literals and also state their respective types?

E

Expert

Verified

Literals: The value of particular data type assign to a variable or constant. The type of Literals is as follows:

A) Integer Literal that is, int x = 5
B) Floating point Literal that is, float x =132.45
C) Character Literal that is, char x = ‘a’, included in only single quotes and single character.
D) String Literal that is, cout << “Welcome”, anything included in double quotes.

   Related Questions in Programming Languages

©TutorsGlobe All rights reserved 2022-2023.