Basics of C
Basics of C
Basics of C
Introduction &basics o f C
o C is a high level, general purpose & structured programming language in which the sequences of
instruction are for a computer to interpret & execute and is ideal for developing firmware or
portable applications.
o Its instruction consists of terms that resembles algebraic expressions, augmented by certain
English keywords.
After a C source file has been created, the programmer must invoke the C
compiler before the program can be executed (run).
return 0;
}
Output
Lets begin
Department of Mechanical Engineering
MEANINGS OF STATEMENTS://#INCLUDE<STDIO.H>//
• Include statement: In 'C' programming language all library functions are included in
different header files in different categories with ".h" extension.
• # is called as "preprocessor". Means it will include the header file before compiling
the code. "include" gives command to include something
• "stdio" stands for "standard input output". As it is a header file so (.h) extension is
there. It contains some standard functions related to input and output such as
"printf", "scanf".
• For example "math.h" includes all mathematical library functions.
• Every C program that can be run must have a main function.When the system starts
the executable, it runs that function by default
• The statement return 0 indicates that main() returns a value of zero to the operating
system.
Stage 3: Linking
o Combines the program object code with other object code to produce the executable
file.
o The other object code can come from the Run-Time Library, other libraries, or
object files that you have created.
o Saves the executable code to a disk file. On the Linux system, that file is called a.out.
#include <stdio.h>
#include <stdlib.h>
main() Output
{ X=5
int x; The value of x is= 5
scanf ("%d",&x);
printf ("The value of x is= %d", x);
return 0;
}