1. C language is an example of imperative / procedural language, but since it is old (no OO or functional programming allowed), is no more required to industry.
True or False
2. Considering an ANSI C compiler what can represent a lexical error?
a. a = )a+(b;
b. a = 0.0a;
c. if (a=3) a++;
d. a = α{"version":"1.1","math":"α"}~b;
b) 0.0a can represent a lexical error because there is no operator between 0.0 and a, and it's lexically correct to assign a variable to itself.
c) if (a=3) a++: This will represent an error because a=3 is not a condition since a is being assign to a instead of comparing a to 3 (a==3)
d) a = α{"version":"1.1","math":"α"}~b; There will be an error because α is not known
Comments
Leave a comment