This document discusses computer programming in C. It covers the program development process and popular integrated development environments (IDEs) like Microsoft Visual Studio, Dev-Cpp, Eclipse, and Turbo C/C++ Builder. It also provides examples of a simple "Hello World" C program and the steps to create, compile, and run it using the Linux command line or a Windows IDE like Turbo C++. Finally, it outlines the typical structure of a C program, including preprocessor statements, function definitions, and the main function.
6. Simple program in C
// file name hello.c
#include<stdio.h>
void main( )
{
printf(“Hello World”);
}
This program in Linux following commands are
used
1)Create: gedit hello.c
2) Compile: gcc hello.c
3) Run: ./a.out
7. On Window Turbo C++ IDE
- To create a new file press File -> New, on menu
bar
- Write down complete program
- To save press F2 or File -> save, on menu bar
- To compile Compile -> compile on menu bar or
ALT+F9 key
If error found then again correct error and need
to compile the same. If no error then, we can
execute program.
- To run Run -> run on menu bar, or CTRL + F9
8.
9.
10.
11. Structure of C Program
Document Section /*Title of the program*/
/*Addition of two no.s*/
Link Section (Header files/
Preprocessor Statements)
#include<stdio.h>
Definition section #define PI 3.142
Global Declaration section int a=20;
main () function section
{
Declaration part;
Execution part;
}
void main(){
int b=10, sum; sum=a+b;
printf(“Sum=%d”,sum);
}
Subprogram section
(user defined function)
Function 1
Function 2
Function n