Which of following isare correct variable names 3A Battery A

Which of following is/are correct variable name(s)? 3A Battery A 3 Battery Orange char. Cheek all reserved word(s) in C language float break continue come visit short return switch signed unsigned print f String str = \"It ia cold today | \" What is the index of the acclamation point? Define a C string named firstName that stores up to 20 characters Don\'t initialize the C string. Given: printf(\"Enter fruit name:\"); scanf(\"%s\", fruitColor); printf(\"Enter fruit color:\"); scan f(\"% S\", fruitName); The user will type Fuji Apple (ENTER) for the fruit name and red (ENTER) for the color. What is stored in fruitColor?

Solution

1. b, and c are correct answers. A variable name is allowed to have alphabets, numbers, and an underscore. A variable name cannot start with a number.

2. a. float, b. break, c. continue, f. short, g. return, h. switch, i. signed, j. unsigned are all reserved words in C.

3. 16 is the index of the exclamation point.

4. char firstName[20]; will define a C string named firstName that stores upto 20 characters.

5. Fuji will be stored for fruitColor.

 Which of following is/are correct variable name(s)? 3A Battery A 3 Battery Orange char. Cheek all reserved word(s) in C language float break continue come visi

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site