



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An overview of the c programming language, including its history, features, and the structure of a c program. It covers the differences between low-level and high-level programming languages, the role of compilers and interpreters, and the steps involved in compiling and executing c programs. The document also introduces the concept of integrated development environments (ides) and the key components of a c program, such as comment lines, preprocessor directives, and the main() function. This comprehensive introduction to c programming would be valuable for students or learners who are new to the language and want to understand its fundamental concepts and development process.
Typology: Lecture notes
1 / 5
This page cannot be seen from the preview
Don't miss anything!




The process of editing, compiling, running, and debugging programs is often managed by a single integrated application known as an Integrated Development Environment, or IDE for short. Structure of C Language program 1 ) Comment line
The main( ) function return value when it declared by data type as int main( ) { return 0 } The main function does not return any value when void (means null/empty) as void main(void ) or void main() { Printf (“C language”); } Output: C language /First c program with return statement/ #include <stdio.h> int main (void) { printf (“welcome to c Programming language.\n”); return 0; } Output: welcome to c programming language.
Step 1: The program that is to be compiled is first typed into a file on the computer system. There are various conventions that are used for naming files, typically be any name provided the
last two characters are “.c” or file with extension .c. So, the file name prog1.c might be a valid filename for a C program. A text editor is usually used to enter the C program into a file. Step 2: After the source program has been entered into a file, then proceed to have it compiled. The compilation process is initiated by typing a special command on the system. When this command is entered, the name of the file that contains the source program must also be specified. Step 3: When all the syntactic and semantic errors have been removed from the program, the compiler then proceeds to take each statement of the program and translate it into a “lower” form that is equivalent to assembly language program needed to perform the identical task. Step 4: After the program has been translated the next step in the compilation process is to translate the assembly language statements into actual machine instructions. The assembler takes each assembly language statement and converts it into a binary format known as object code, which is then written into another file on the system. Step 5: After the program has been translated into object code, it is ready to be linked. This process is once again performed automatically whenever the cc or gcc command is issued under Unix. The purpose of the linking phase is to get the program into a final form for execution on the computer. Step 6: To subsequently execute the program, the command a.out has the effect of loading the program called a.out into the computer’s memory and initiating its execution.