12th Class Computer Chapter 2 Fundamentals of C Language Short Questions Answer
12th Class Computer Chapter 2 Fundamentals of C Language Short Questions Answer
Define constant?
The quantities whose values do not change during program execution are known as constants.
How many types of constants?
Constants are of two types i.e. numeric and character/string.
Write the types of Numeric Constants.
Numeric Constants are of two types. i.e.
1. Integers
2. Floating-point numbers
What are integers?
Integers represent values that are counted like the number of students in a class.
What is an integer constant?
An integer constant is a string of digits that does not include commas or a decimal point.
Write down some examples of valid integer constants?
Some examples of valid integer constants are:
0, 714, -234, 24494
Define Floating-point Constants?
Floating-point constants are also called real constants. Floating-point constants are used to represent values that are measured, like the height of a person which might have a value of 166.75 cm.
What is a character Constant?
A character Constant is one of the symbols in the C character set. Although this character set may vary from one C implementation to another, it usually included digits 0 through 9, upper case letters. Although Z, lower case letters a through Z, punctuation symbols such as semicolon (;), comma (,), period ( ) and special symbols such as +,–, =, > etc.
How do enclose a character constant?
A character constant is enclosed by single quotes such as ‘a’.
Define a variable.
A variable is a location in memory that is identified by a name that we supply and which we can use to store an item of data of particular type.
How many things are required for specifying a variable?
Specifying a variable therefore requires two things i.e.
I. We must give it a name
II. We must identify what king of data we shall store in it.
How does a variable begin?
A variable begins with a better or underscore ( – ) and may consist of betters, underscores and/or digits.
What is the use of the underscore?
The underscore may be used to improve readability of the variable name.
What is meant by only the first 31 characters of a variable are significant?
Only the first 31 characters of a variable are significant. This means that if two variables have the some first 31 characters they are considered to be the same variables.
What do you know about the keywords of C language?
C language has a very small set of keywords such as into, do, if, etc. Which are part of the programming language and may not be used as variable names. These keywords are also known as reserved words.
Write down the types of variables in “C”.
C provides three types of variables.
I. Integer variables
II. Floating-point variables
III. Character variables
Write down the Integer variable declaration statement?
Integer variable declaration statement has the form: into sum;
How can you precede the declaration of on integer variable?
Declaration of an integer variable can be preceded by the qualifiers short, long unsigned or signed.
What is the use of Floating-point variables?
Floating-point variables are used for storing floating-point numbers.
In which part floating-point number are stored in memory?
Floating-point numbers are stored in memory in two parts. The first part is the mantissa and the second part is the exponent.