ASSIGNMENT 1
Submitted By,
BATCH - 2
Roll No : 11 - 20
COMPUTER PROGRAMMING
ASSIGNMENT 1
1
Qn 1. Which of the following are invalid variable names and why?
• n$bc
• matrix 1
• and abc
• float
Ans.
2
operand occupies. The operand may be a variable, a constant or a data type
qualifier.
Eg : m = sizeof(long int);
If (i=0)
Print (“Zero”);
Else
Printf (“Non-Zero”);
Qn 4. What are the rules of syntax according to which valid identifiers are
defined in ‘C’ ?
3
3. Only first 32 characters are significant in most compilers. So
use identifiers that are smaller than 32 characters in length.
4. Cannot use a keyword
5. Must not contain white space.
Ans. The given real constant 123C5 is not valid. The character C is illegal
in a real constant. Real constant may only consist of Integer numbers,
decimal notation and exponential notation.
Integer numbers are inadequate to represent quantities that vary
comtinuously, such as distance, height, temperature, prices and so on. These
quantities are represented by numbers containing fractional part like 17.548.
Such numbers are called real constants or floating point constants.
4
*******************