Discussion
Which of the following has compilation error in C ?
Answer: D
None of the declarations has a compilation error, so 'none of the above' is correct. int n = 32; is a plain initialisation. char ch = 65; is allowed because 65 fits in a char and is the code of 'A'. float f = (float) 3.2; is a valid cast from a double constant to float.
Each of the first three lines is therefore legal C, and no option other than the last can be the answer to a 'which has an error' question.
No comment is present. Be the first to comment.
Loading…
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development