Monday, 28 September 2020

Name different categories of constants in C language.

 Question: Name different categories of constants in C language.

Answer

A constant is an identifier whose value cannot be changed throughout the execution of a program whereas the variable value keeps on changing. In C there are four basic types of constants. They are:

1. Integer constants
2. Floating point constants
3. Character constants
4. String constants

Example

Integer constant: 147
Floating point constants: 34.56
Character constants: 'A', '\r'
String constants: "A", "EFH"

No comments:

Post a Comment

MCQ Question Bank Microsoft PowerPoint