The Gateway to Computer Science Excellence
+4 votes

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>
in Programming by (317 points) | 3.4k views
The char data type stores any string of letters, numbers, and symbols. It can even accept signed numbers.

3 Answers

+4 votes
Best answer
None of them not even giving any compiler warning even with strict C standard.
by Veteran (432k points)
According to ISRO, answer is D option.
there goes a satellite in Bay of Bengal.
@Digvijay I suppose given the choices one should go with D because it is a preprocessor directive :)
+7 votes
Yes ; all r seeming correct;

But a,b,c options are absolutely correct.

Now come to option D;;

Now Suppose User has installed TC & then he had move this into another location say D drive without intimating this change to TC. Then while compiling it will get err bcz it will search Library file STDIO.H in C:/TC/INCLUDE which is not available der due to users move operation;Hence it is one of the possibilities to Get Compiler Err.

by (137 points)
edited by
Good. But never say anything like this is any IIT interview. They will kick you out even if you spell Turbo C.

"stdio.h" is a standard header file defined by C standard. And "include <stdio.h>" is also standard way of including the header file. A programmer/user need not have to worry about the location of the header file here- it is up to the compiler to find that.
+1 vote

By looking at them i would like say there is no error.

Here ans is #include<stdio.h> which is not appropriate but compared to other .Now See

int n=17; //No error since int value

char c=99 ;// char even take int so no error

float=(float)99.32 //No error float is type-casting

#include<stdio.h>//If you have single statement"#include<stdio.h>" Compiler  Simply generate error Undefined reference to main()

Source -

by Loyal (10k points)
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,737 questions
57,391 answers
105,442 users