answersLogoWhite

0

Can you write any simple c program without header file?

Updated: 8/17/2019
User Avatar

Wiki User

14y ago

Best Answer

Yes you (usually) can, though it may depend on your particular C implementation.

// A complete (if useless) C program to compute the square root of 2 and then exit.

// No headers required.

double sqroot(const double s) {

double xn = s / 2.0;

double lastX = 0.0;

while(xn != lastX) {

lastX = xn;

xn = (xn + s/xn) / 2.0;

}

return xn;

}

int main() {

double sqrt2 = sqrt(2);

return 0;

}

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Can you write any simple c program without header file?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

You want to write a simple without using pointer or array c program which will print greatest number when you give 20 number?

i want to write a simple without using pointer or array c program which will print greatest number when i give 20 number .........How far have you gotten so far?


How to write a C program to find the header record in a file .please advice?

Just open the file, read-in N bytes and then examine (parse) for known header values or signature.


Can you write a program without main in c?

Certainly, you can write a program without main, but you cannot build an executable from it, if that is okay with you.


How do you write http?

some simple things about HTTP are; always start with <http> and finish with </http> here area few notes body=<body> </body> header=<header> </header> BOLD, under lined and italic <b><u><i> paragraph=<p>


How do we write c program without using swap to interchange values by accessing another variable?

int a,b; a=a+b; b=a-b; a=a-b; that's it simple


Write a c program for false position method?

Write a simple program in finding roots x^3-6x^2+11x-6.1=0


How do you write a C program to find the Simple Interest?

Reference:cprogramming-bd.com/c_page1.aspx#simpleinterest


How to write a letter to a friend asking him about summer vacations outing program?

Writing a letter to a friend asking him about a summer vacations outing program is simple. Ask him when and where the program will be.


How do you set up a header on a formal essay?

Go to Format or was it View?? Then click on headers and footers. Select Header and press Edit Header and write what you want. Simples!!! :)


Write a C program which will ask the operator to enter amount to be invested for the period of investment and the rate of interest for simple interest and compound interest calculation?

Or you could just do the same thing in a spreadsheet without having to pay commercial rates for the program to be written for you


What is the best answer for why do we write and without telling the writing histories?

We write because we can't not write. Simple as that. Writers are storytellers, and we have to tell our stories.


Can you write hello world without operating system?

Yes, you can write a "hello world" program without an operating system using bare metal programming. This involves directly interfacing with the hardware of a computer system without an intermediary operating system. The program can be written to access and output text to a display device without the need for an OS.