Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
303 views
in Information Technology by (113k points)
closed by
Which of the following has the compilation error in C?
1. int n = 17;
2. char c = 99;
3. float f = (float) 99.32;
4. #include < stdio.h >

1 Answer

0 votes
by (115k points)
selected by
 
Best answer
Correct Answer - Option 4 : #include < stdio.h >

The correct answer is option 4.

Explanation :

Option 1:

No error since assigning an integer value to a variable and value 17 is inside the range of integer i.e. -32768 to +32767.

Option 2:

No error since value 99 is ASCII value, hence whatever character has ASCII value 99 will be assigned to char c.

Option 3:

No error since float data type allows float typecasting.

Option 4:

  • Generally, no error should occur in this header file but an error may occur in the following conditions :
  •  Moving this header file to another drive (excluding the drive where TURBO C is installed) may cause an error since the compiler will find the header file in the drive where TURBO C is installed & throw a compilation error.
  • C program with single header file #include<stdio.h> can throw error "undefined reference to main() function"

Hence, the correct answer is "#include<stdio.h>".

NOTE: 

Option 4 is the correct answer in official ISRO paper

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...