Can we write a c prog without #include?

Showing Answers 1 - 12 of 12 Answers

senthilkumar

  • Nov 16th, 2006
 

no,#include is nessesary.

  Was this answer useful?  Yes

srikar

  • Nov 17th, 2006
 

no need to define it explictly. some compilers take it default

  Was this answer useful?  Yes

yashi

  • Nov 18th, 2006
 

yes,

a c-prog can be executed without the use of #include.

but we must not use any library functions.

  Was this answer useful?  Yes

shreyans

  • Nov 20th, 2006
 

yes we can do lie

***********************

int main()

{

      return 0;

}

***********************

this is also a C program without #include

  Was this answer useful?  Yes

Sundar A

  • Nov 29th, 2006
 

Yes. A header file will provide information about "prototype of an exported function(probably from other modules)", "exported variables (extern)", "macros", "functions bodies for static inline functions", etc. basically none of them will allocate a memory by itself. The below code will work very fineint printf(const char *fmt, ...);unsigned int strlen(const char *str);int main(){ char *s = "Hello World"; printf ("String s [%s] has %d characters in it.n", s, strlen(s)); return 0;}

  Was this answer useful?  Yes

naresh

  • Dec 3rd, 2006
 

it is not necessary.

  Was this answer useful?  Yes

Supriya Ahire

  • Jan 15th, 2007
 

Yes ,

we can but it's depends on Operating system we r using.....

    if we r using DOS  operating system Turbo C onDOS includes all header files.But If we r using windows operatinmg System we must have to use #include.

  Was this answer useful?  Yes

mohit

  • Jan 22nd, 2007
 

yes

  Was this answer useful?  Yes

mohit

  • Jan 22nd, 2007
 

yes we can use ??= include insted of # include or "include stdio.h"

  Was this answer useful?  Yes

giridhar

  • Feb 2nd, 2007
 

Yes, In linux (GCC Compiler) we can write a C program without #include. But for special header files which are not part of C standard library, we may have to include the headers.

  Was this answer useful?  Yes

navin_chand

  • Mar 25th, 2007
 

you need not write #include, but at the time of compilation you need to compile with options which direct compiler to include files in the provided directory. in gcc it is done by -I option.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions