Computer Science, asked by nainarajput69, 3 months ago

a) int = 314.562 * 150 ;
b) name = 'Ajay';
c) varchar = '3';
d) 3.14 *r*r* h = vol_of_cyl ;
*
point out the error,if any,in the following c statemens:​

Answers

Answered by jkarakeel19
3

Answer:

a. int is a key word so should not be used as a variable.

b. ‘Ajay’ is an invalid character constant.

c. ‘3’ is invalid character constant because it uses inverted commas ‘ ’ on opposite side.

d. error on left hand side of = can only be a variable.

Explanation:

b. Ø A character constant is a single alphabet, a single digit or a single special symbol enclosed within single inverted commas. Both the inverted commas should point to the left. For example, ’A’ is a valid character constant whereas ‘A’ is not.

Ø The maximum length of a character constant can be 1character

Similar questions