Programming in C, Constant, Numeric, Character, String.

Question 1: Explain what are constant? 

Ans: Constant are quantities whose values do not change during program execution.

They may be..

1. Numeric.

2. Character.

3. String.


Constant in C Language

Numeric constants are of two types, integer and floating point numbers.

Integer constant represent values that are counted, like the number of students in a class. e.g: 7145, 234 etc.

Floating point constants are used to represent values that are measured, like the height of a person which might have a value of 166.75cm etc

Character constant is one of the symbols on c character set . It includes digits 0 to 9, upper cases A to Z and lower cases a to z. etc.

String constant contains a string of characters within double quotes such as “Hello Ahmed” etc.

Comments

Popular posts from this blog

Conditional Control structure. Chapter 4, Lab Activities, Long questions.

Chapter # 5, Loop Control Structure, Lab Activities