C programming tutorials
In our first C program We will print "hello world C " on our monitor screen.
Open your editor
If you are using turbo C Following are the steps to open editor.
1.Run TC.exe usually present in C:\TC\BIN.
2.select NEW from the File menu.
3.Type the program
4.Save the program using F2 with a name.
After writing this program compile and execute it.
5. Use Ctrl+F9 on Turbo C to compile and execute the program.
6.Use Alt +F5 to see the output.
Output:
hello world C .
Congrats you have successfully executed your first C program.
Let us see what are the use of statements used in above program.printf is function used to print any string or line on monitor.Working of printf fuction or how printf function works is defined in file stdio.h
.That is why it is necessary to include header file stdio.h in our program.This file have extension .h.This file is known as header file.Name of header file is written inside< >.
Name of header file is always preceded with #include. # is instruction to preprocessor.# is known as preprocessor directive
It is it is a separate program invoked by the compiler before compilation(translating program into binary code) as the first part of translation.
preprocessor replaces the line #include <stdio.h> with the header file stdio.h, which declares the printf() function among other things. More precisely, the entire text of the file 'stdio.h' replaces the #include directive
Hence the source code of printf will automatically be include in program by preprocessor before compilation.T