SlideShare a Scribd company logo
Basic Information About C Language [Updated]
blogwaping.com/2020/07/c-language.html
Do you want to learn basic information about thec Language?
Yes!
That’s great.
This article is the right choice for you.
Here, I will provide you all the basic information about C language.
Introduction Of C Language
C is a high-level computer programming language.
It is also known as:
Mother programming language
System programming language
Mid-level programming language
Procedure-oriented programming language
Structured programming language
Usually, this language is designed to be compiled with a relatively simple
compiler.
It provides low-level access to memory.
1/18
So, it requires minimum runtime support to process instructions.
If you learn this language, another programming language iseasy to
understand for you.
History Of C Language
It is interesting to know the history of the C language.
Here, I discuss abrief history of the c language.
It was originally invented byDennis Ritchie in 1972 at AT & T’s Bell
Laboratory in the USA.
It was primarily developed to writingUNIX operating system.
Gradually, it becomes a verypopular programming language in the
worldwide.
It has been standardized by theAmerican National Standards Institute
(ANSI) since 1989 and subsequently by the International Organization for
Standardization (ISO).
Timeline of C language development
2/18
Version Name Year Developer
C 1972 Dennis Ritchie
K&R C 1978 Brian Kernighan & Dennis Ritchie
ANSI C 1989 ANSI Committee
ISO C 1990 ISO Committee
C99 1999 Standardization Committee
C11 2011 Standardization Committee
C18 2017/2018 Standardization Committee
Features Of C Language
There are different types of features are available in the C language.
All the features are not possible to mention in one article.
Although, some of the key features are mentioned here:
Fast and Efficient
Easy to Extend
Procedural Language
Simple and clean style
Middle-Level Language
Low-level access to memory
Libraries with rich Functions
Rich set of built-in Operators
A simple set of keywords
Support memory management
3/18
These features make C language suitable for system programs like an
operating system or compiler development.
Later programming languages have borrowedsyntaxes and features directly
or indirectly from C language.
Java, PHP, JavaScript, and many other programming languages are mainly
based on C language.
Note: C++ is almost a superset of C (very few programs can be compiled with
C, but not with C++).
Data Types
Each variable contains a specific data type.
Data types are used to define thedata storage format.
Each data type requires different amounts of memory space and has some
specific features.
There are mainly 4 data types that are mostly used in c programming.
4/18
Those are described here.
int: It is used to store an integer type value (numbers).
char: It stores a single character (alphabets).
float: It is used to store decimal numbers (floating-point value) with
single precision.
double: It is also used to store decimal numbers (floating-point value)
with double precision.
An int is signed by default.
It means it can represent bothpositive and negative values.
On the other hand, anunsigned int can never be negative.
All data types are listed here.
Data Type Memory
(Bytes)
Range Format
specifier
short int 2 -32768 to 32767 %hd
unsigned short int 2 0 to 65535 %hu
unsigned int 4 0 to 4294967295 %u
int 4 -2147483648 to
2147483647
%d
long int 8 -2147483648 to
2147483647
%ld
unsigned long int 8 0 to 4294967295 %lu
long long int 8 -(2^63) to (2^63)-1 %lld
unsigned long long
int
8 0 to
18446744073709551615
%llu
signed char 1 -128 to 127 %c
unsigned char 1 0 to 255 %c
float 4 %f
double 8 %lf
long double 16 %Lf
5/18
You can also use the sizeof() operator to check thesize of any variable.
Variables
A variable is a simple word or letter that allocates some space in memory.
Basically, a variable used to store some different types of data.
Different types of variables require different amounts of memory and have
some specific set of operations that can be applied to them.
/*variable declaration*/
int a;
char b;
float c;
Rules For Defining Variables
1. A variable can have any alphabet, digit, and underscore.
2. A variable name must start only with the alphabet, and underscore. It
can’t start with a digit.
3. No space is allowed within the variable name.
4. A variable name can not be any reserved word or keyword. (e.g. int,
void, etc.)
Arrays
An array is a data structure that contains the same types of data items.
A variable can carry only one data item at a time.
If you want to store multiple data items in a data type, you need to use an
array.
You can not initialize an array with more elements than the specified size.
The specified size is declared to the left of the variable between thethird
brackets.
6/18
A one-dimensional array is like a row list.
On the other hand, atwo-dimensional (2D) array is like a table.
Arrays consist of contiguous memory locations.
Array Declaration
1. Array declaration by specifying the size
int a[5];
2. Array declaration by initializing the elements
int a[] = { 10, 20, 30, 40 };
3. Array declaration by specifying the size and initializing the
elements
int arr[5] = { 10, 20, 30, 40 };
Note: You can use While or For loops to add values in the variables.
Pointers
A pointer is a variable that stores theaddress of another variable.
For example, an integer variable stores an integer value, however an integer
pointer stores the address of an integer variable.
We use the unary operator & (ampersand) that returns theaddress of a
variable.
7/18
#include <stdio.h>
int main()
{
int x;
printf("%p", &x);
return 0;
}
Here, &x print the address of variable x.
Keywords
Keywords are specificreserved words in C which attached with a specific
feature.
The list of keywords includes almost all the words that can help us to use the
functionality of the C language.
C does not contain very large number of keywords.
However, there are 32 keywords are available inC98 language.
auto break case char const
continue default do double else
enum extern float for goto
if int long register return
short signed sizeof static struct
switch typedef union unsigned void
volatile while
C99 reserved five more keywords.
_Bool _Imaginary restrict _Complex inline
C11 reserved seven more keywords.
_Alignas _Atomic _Noreturn _Thread_local _Alignof
_Generic _Static_assert
8/18
Most of the recently reserved words begin with anunderscore followed by a
capital letter.
Because identifiers of that form were previously reserved by the C standard for
use only by implementations.
Operators
C supports a rich set of operators, which are different types of symbols.
Each operator performs a specific operation with a variable.
All operators are listed in the following table.
Operator Name Operator Symbol
Arithmetic +, -, *, /, %
assignment =
augmented assignment +=, -=, *=, /=, %=, &=, |=, ^=, <<=, >>=
bitwise logic ~, &, |, ^
bitwise shifts <<, >>
boolean logic !, &&, ||
conditional evaluation ? :
equality testing ==, !=
calling functions ( )
increment and decrement ++, —
member selection ., ->
object size sizeof
order relations <, <=, >, >=
reference and dereference &, *, [ ]
sequencing ,
subexpression grouping ( )
type conversion (typename)
9/18
These operators tell the compiler to perform specificmathematical or
logical operations.
Memory Management
The most important function of a programming language is to provide
facilities for managing memory and objects that are stored in memory.
C language provides 3 unique ways to allocate memory for objects.
Static Memory Allocation
This is an allocation technique that allocates a fixed amount of memory during
compile time.
Dynamic Memory Allocation
This is also an allocation technique that manages system memory at
runtime.
Automatic Memory Allocation
When you declare an automatic variable (such as a function argument or a
local variable), then it happens.
Libraries
Library functions are inbuilt functions in C language that are grouped
together in common files. This file is called the C standard library.
Each library provides specific functions to perform specific operations.
We can use these library functions to get the pre-defined output instead of
writing your own huge complex code to get those outputs.
All C standard library functions are declared in header files which are saved as
filename.h.
10/18
We are including the library in theheader files in our C program.
#include<filename.h>
The command allow to use of the functions that are declared in the header
files.
Basic Structure Of C Program
A set of rules is defined for the C programs that are calledprotocols.
The protocols help us to design the basic structure of a program.
Here, I mentioned thebasic structure of a C program.
Documentation section
Link section
Definition section
Global declaration section
Main function section
Sub-program section
All C programmers must follow theprotocols when writing any program.
Let’s discuss all thebasic structure sections of a C program.
Documentation Section
The documentation section is a part of the program where the programmers
provide the details about the program.
In this section programmers usually give thename of the program and the
details related to the program.
This code gives an overview of the program.
//program name
/*This is a
C Program*/
Link Section
This section is used todeclare all theheader files that will be used in the
program.
11/18
It tells the compiler tolink the header files to the system library.
#include<stdio.h>
Definition Section
In this section, we can define different types of constants.
The keyword define is used to define a constant value in this part.
#define PI=3.14
Global Declaration Section
All the global variables are declared in this section.
User-defined functions are also declared in this section of the code.
int a,b,c;
Main Function Section
Every C-programs must have the main function.
The main function contains 2 parts.
1. Declaration Part: All thevariables are declared in this part.
2. Execution Part: This part starts with thecurly brackets and ends with
the curly close bracket.
Both the declaration and the execution part are writing inside the curly
braces.
int main()
{
int a=5;
printf(" %d", a);
return 0;
}
Sub-program Section
All user-defined functions are defined in this section.
12/18
int add(int a, int b)
{
return a+b;
}
Hello World C Program
This is the source code of a basic “Hello World” Program.
13/18
#include<stdio.h>
int main()
{
/*First basic C Program*/
printf("Hello World.");
getch();
return 0;
}
After compiling the source code the output will be the following:
Output:
Hello World.
Explanation of “Hello World” C Program
Here, I explained each line of the “Hello World” C program.
#include <stdio.h>
This is a preprocessor command that includes the inputheader file from the
C library before compiling a program.
int main()
This is the main function of executing any C program begins.
{
It represents the beginning of the main program.
/*First basic C Program*/
If any words exist inside the command/* and */ in any C program that won’t
be considered for compilation and execution. This is also called a comment
line.
printf(“Hello World.“);
The printf command displays the words in the quote on the screen.
getch();
This function is used to hold the output screen and wait until the user gives
any type of input. So that we are able to see the output on the screen.
return 0;
14/18
Here, the return is a keyword that is used to return some value from a
function.
The main function returns an integer value, therefore here we are returning
0.
It means our program has beenrun successfully and we terminate ourmain
function with this return statement.
}
It represents the ending of the main program.
Create a C Program
Are you want to create and execute a C programs yourself?
Then you need to follow the instructions:
1. At first, you need toinstall a C supported IDE (Integrated Development
Environment) on your computer.
2. Once the IDE is installed on your computer, you canopen and create a
C program.
If you don’t want to install theIDE on your computer, you can use anonline
compiler or IDE.
The good thing about theonline compiler is it can compileC, C++, C#,
Java, and many other programming languages.
We also provide some links to the online and offlineIDE in this article that
can help you to create and execute your C program easily.
Best IDE For C
15/18
You can create and edit C programs with any code editor or even a general
editor.
Yet, it is very important to choose thebest IDE for beginners.
If the IDE is integrated with the C compiler, the process ofcreating and
compiling the C program will be easier.
Anyway, we collect some best IDE for c program that can help you to write
and execute any c program easily.
Here are some collection,
Run C Program Online
Onlinegdb IDE
Tutorialspoint IDE
Rextester IDE
Run C Program On Android Phone
TruboCdroid
Cxxdroid
TurboCPlus
CppDroid
Run C Program On Windows
Turbo C++
Dev C++
16/18
Code::Blocks IDE
Run C Program In Mac OS
Turbo C++
Code::Blocks IDE
Run C Program In Linux
Code::Blocks IDE
Choose the best IDE that makes youcomfortable to create and edit the C
program.
Thus, your programming skills will increase and you will be able tocreate
any program within a few minutes.
Advantages Of C Language
It is one of the most useful programming languages when the system
requires quick and direct access to the hardware.
C is the most commonly used system withlimited resources (such as
memory).
Where performance is the most important attribute, C is the best
choice for programmers.
Disadvantages Of C Language
C does not support OOP (Object-oriented programming) concepts, that’s
why C++ is developed.
There is no runtime checking ability in the C language. It only does
compile-time checking.
It does not support the concept of thenamespace. We cannot declare
two variables of the same name without namespace.
It does not have the concept ofconstructor and destructor.
Uses Of C Language
There are different types of uses of C language in programming.
Some uses are the following:
17/18
C mainly used to develop system software, operating systems, BIOS,
Embedded Systems, Real-time systems.
To develop application software like databases (MySQL) and 3D
software (Autodesk Maya).
Used to create graphical related applications like computers and mobile
games.
To evaluate any types of logical and mathematical equations using c
language.
UNIX kernel is completely made in C Language.
The language is used to design different languagecompilers.
Conclusion
The C language doesn’t seem to have anexpiration date.
It has a closeness to thehardware, great portability, and deterministic
usage of resources.
For these features, it is theideal programming language for low-level
development of things like operating system kernels and embedded software.
Its good performance, efficiency, and versatility make it anexcellent choice
to develop highly complex data manipulation software like MySQL, 3D
animation, and more.
C is still unsurpassed where performance is the main priority.
I hope now you know all thebasic information about the C language.
18/18

More Related Content

PPT
C language
PPT
Unit 4 Foc
PPSX
C language (Collected By Dushmanta)
DOC
1. introduction to computer
DOC
C language
PPTX
Introduction to C Unit 1
PPTX
Introduction to C Programming
C language
Unit 4 Foc
C language (Collected By Dushmanta)
1. introduction to computer
C language
Introduction to C Unit 1
Introduction to C Programming

What's hot (20)

ODP
Basic C Programming language
DOCX
Features of c language 1
PPT
The smartpath information systems c pro
PPT
Tokens_C
PPT
C Language
PPTX
C programming Training in Ambala ! Batra Computer Centre
DOC
C notes for exam preparation
PDF
Structures
ODP
OpenGurukul : Language : C Programming
ODP
CProgrammingTutorial
PPT
C program
PDF
Learn c language Important topics ( Easy & Logical, & smart way of learning)
PPT
Introduction to c programming
PPT
C language introduction
PPT
Fundamental of C Programming Language and Basic Input/Output Function
PPT
Introduction to C Programming - I
PDF
Features of c
PPTX
Structure of c_program_to_input_output
DOC
Basic c
Basic C Programming language
Features of c language 1
The smartpath information systems c pro
Tokens_C
C Language
C programming Training in Ambala ! Batra Computer Centre
C notes for exam preparation
Structures
OpenGurukul : Language : C Programming
CProgrammingTutorial
C program
Learn c language Important topics ( Easy & Logical, & smart way of learning)
Introduction to c programming
C language introduction
Fundamental of C Programming Language and Basic Input/Output Function
Introduction to C Programming - I
Features of c
Structure of c_program_to_input_output
Basic c
Ad

Similar to Basic Information About C language PDF (20)

DOCX
Let's us c language (sabeel Bugti)
PPT
C material
PPSX
Lecture 2
PDF
Essential c
PDF
Essential c
PDF
Essential c
PDF
Essential c notes singh projects
PDF
Essential c
PPTX
C language
PDF
C programming language tutorial for beginers.pdf
PPSX
Programming in C [Module One]
PPTX
Introduction to C Programming fjhjhjh.pptx
PDF
introduction to programming using ANSI C
PDF
C programming day#1
PPTX
Lec 02 Introduction to C Programming.pptx
PPTX
Introduction to c
PPTX
Fundamentals of Data Structures Unit 1.pptx
PPTX
venkatesh.pptx
PPTX
Fundamental programming Nota Topic 2.pptx
PPTX
PPS_unit_2_gtu_sem_2_year_2023_GTUU.pptx
Let's us c language (sabeel Bugti)
C material
Lecture 2
Essential c
Essential c
Essential c
Essential c notes singh projects
Essential c
C language
C programming language tutorial for beginers.pdf
Programming in C [Module One]
Introduction to C Programming fjhjhjh.pptx
introduction to programming using ANSI C
C programming day#1
Lec 02 Introduction to C Programming.pptx
Introduction to c
Fundamentals of Data Structures Unit 1.pptx
venkatesh.pptx
Fundamental programming Nota Topic 2.pptx
PPS_unit_2_gtu_sem_2_year_2023_GTUU.pptx
Ad

Recently uploaded (20)

PPTX
L1 - Introduction to python Backend.pptx
PDF
Digital Strategies for Manufacturing Companies
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
How Creative Agencies Leverage Project Management Software.pdf
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PPTX
Reimagine Home Health with the Power of Agentic AI​
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
Softaken Excel to vCard Converter Software.pdf
PPTX
Introduction to Artificial Intelligence
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
Understanding Forklifts - TECH EHS Solution
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PPTX
Transform Your Business with a Software ERP System
L1 - Introduction to python Backend.pptx
Digital Strategies for Manufacturing Companies
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
How Creative Agencies Leverage Project Management Software.pdf
Navsoft: AI-Powered Business Solutions & Custom Software Development
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Reimagine Home Health with the Power of Agentic AI​
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Softaken Excel to vCard Converter Software.pdf
Introduction to Artificial Intelligence
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
Odoo Companies in India – Driving Business Transformation.pdf
PTS Company Brochure 2025 (1).pdf.......
Upgrade and Innovation Strategies for SAP ERP Customers
Design an Analysis of Algorithms II-SECS-1021-03
Understanding Forklifts - TECH EHS Solution
CHAPTER 2 - PM Management and IT Context
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Transform Your Business with a Software ERP System

Basic Information About C language PDF

  • 1. Basic Information About C Language [Updated] blogwaping.com/2020/07/c-language.html Do you want to learn basic information about thec Language? Yes! That’s great. This article is the right choice for you. Here, I will provide you all the basic information about C language. Introduction Of C Language C is a high-level computer programming language. It is also known as: Mother programming language System programming language Mid-level programming language Procedure-oriented programming language Structured programming language Usually, this language is designed to be compiled with a relatively simple compiler. It provides low-level access to memory. 1/18
  • 2. So, it requires minimum runtime support to process instructions. If you learn this language, another programming language iseasy to understand for you. History Of C Language It is interesting to know the history of the C language. Here, I discuss abrief history of the c language. It was originally invented byDennis Ritchie in 1972 at AT & T’s Bell Laboratory in the USA. It was primarily developed to writingUNIX operating system. Gradually, it becomes a verypopular programming language in the worldwide. It has been standardized by theAmerican National Standards Institute (ANSI) since 1989 and subsequently by the International Organization for Standardization (ISO). Timeline of C language development 2/18
  • 3. Version Name Year Developer C 1972 Dennis Ritchie K&R C 1978 Brian Kernighan & Dennis Ritchie ANSI C 1989 ANSI Committee ISO C 1990 ISO Committee C99 1999 Standardization Committee C11 2011 Standardization Committee C18 2017/2018 Standardization Committee Features Of C Language There are different types of features are available in the C language. All the features are not possible to mention in one article. Although, some of the key features are mentioned here: Fast and Efficient Easy to Extend Procedural Language Simple and clean style Middle-Level Language Low-level access to memory Libraries with rich Functions Rich set of built-in Operators A simple set of keywords Support memory management 3/18
  • 4. These features make C language suitable for system programs like an operating system or compiler development. Later programming languages have borrowedsyntaxes and features directly or indirectly from C language. Java, PHP, JavaScript, and many other programming languages are mainly based on C language. Note: C++ is almost a superset of C (very few programs can be compiled with C, but not with C++). Data Types Each variable contains a specific data type. Data types are used to define thedata storage format. Each data type requires different amounts of memory space and has some specific features. There are mainly 4 data types that are mostly used in c programming. 4/18
  • 5. Those are described here. int: It is used to store an integer type value (numbers). char: It stores a single character (alphabets). float: It is used to store decimal numbers (floating-point value) with single precision. double: It is also used to store decimal numbers (floating-point value) with double precision. An int is signed by default. It means it can represent bothpositive and negative values. On the other hand, anunsigned int can never be negative. All data types are listed here. Data Type Memory (Bytes) Range Format specifier short int 2 -32768 to 32767 %hd unsigned short int 2 0 to 65535 %hu unsigned int 4 0 to 4294967295 %u int 4 -2147483648 to 2147483647 %d long int 8 -2147483648 to 2147483647 %ld unsigned long int 8 0 to 4294967295 %lu long long int 8 -(2^63) to (2^63)-1 %lld unsigned long long int 8 0 to 18446744073709551615 %llu signed char 1 -128 to 127 %c unsigned char 1 0 to 255 %c float 4 %f double 8 %lf long double 16 %Lf 5/18
  • 6. You can also use the sizeof() operator to check thesize of any variable. Variables A variable is a simple word or letter that allocates some space in memory. Basically, a variable used to store some different types of data. Different types of variables require different amounts of memory and have some specific set of operations that can be applied to them. /*variable declaration*/ int a; char b; float c; Rules For Defining Variables 1. A variable can have any alphabet, digit, and underscore. 2. A variable name must start only with the alphabet, and underscore. It can’t start with a digit. 3. No space is allowed within the variable name. 4. A variable name can not be any reserved word or keyword. (e.g. int, void, etc.) Arrays An array is a data structure that contains the same types of data items. A variable can carry only one data item at a time. If you want to store multiple data items in a data type, you need to use an array. You can not initialize an array with more elements than the specified size. The specified size is declared to the left of the variable between thethird brackets. 6/18
  • 7. A one-dimensional array is like a row list. On the other hand, atwo-dimensional (2D) array is like a table. Arrays consist of contiguous memory locations. Array Declaration 1. Array declaration by specifying the size int a[5]; 2. Array declaration by initializing the elements int a[] = { 10, 20, 30, 40 }; 3. Array declaration by specifying the size and initializing the elements int arr[5] = { 10, 20, 30, 40 }; Note: You can use While or For loops to add values in the variables. Pointers A pointer is a variable that stores theaddress of another variable. For example, an integer variable stores an integer value, however an integer pointer stores the address of an integer variable. We use the unary operator & (ampersand) that returns theaddress of a variable. 7/18
  • 8. #include <stdio.h> int main() { int x; printf("%p", &x); return 0; } Here, &x print the address of variable x. Keywords Keywords are specificreserved words in C which attached with a specific feature. The list of keywords includes almost all the words that can help us to use the functionality of the C language. C does not contain very large number of keywords. However, there are 32 keywords are available inC98 language. auto break case char const continue default do double else enum extern float for goto if int long register return short signed sizeof static struct switch typedef union unsigned void volatile while C99 reserved five more keywords. _Bool _Imaginary restrict _Complex inline C11 reserved seven more keywords. _Alignas _Atomic _Noreturn _Thread_local _Alignof _Generic _Static_assert 8/18
  • 9. Most of the recently reserved words begin with anunderscore followed by a capital letter. Because identifiers of that form were previously reserved by the C standard for use only by implementations. Operators C supports a rich set of operators, which are different types of symbols. Each operator performs a specific operation with a variable. All operators are listed in the following table. Operator Name Operator Symbol Arithmetic +, -, *, /, % assignment = augmented assignment +=, -=, *=, /=, %=, &=, |=, ^=, <<=, >>= bitwise logic ~, &, |, ^ bitwise shifts <<, >> boolean logic !, &&, || conditional evaluation ? : equality testing ==, != calling functions ( ) increment and decrement ++, — member selection ., -> object size sizeof order relations <, <=, >, >= reference and dereference &, *, [ ] sequencing , subexpression grouping ( ) type conversion (typename) 9/18
  • 10. These operators tell the compiler to perform specificmathematical or logical operations. Memory Management The most important function of a programming language is to provide facilities for managing memory and objects that are stored in memory. C language provides 3 unique ways to allocate memory for objects. Static Memory Allocation This is an allocation technique that allocates a fixed amount of memory during compile time. Dynamic Memory Allocation This is also an allocation technique that manages system memory at runtime. Automatic Memory Allocation When you declare an automatic variable (such as a function argument or a local variable), then it happens. Libraries Library functions are inbuilt functions in C language that are grouped together in common files. This file is called the C standard library. Each library provides specific functions to perform specific operations. We can use these library functions to get the pre-defined output instead of writing your own huge complex code to get those outputs. All C standard library functions are declared in header files which are saved as filename.h. 10/18
  • 11. We are including the library in theheader files in our C program. #include<filename.h> The command allow to use of the functions that are declared in the header files. Basic Structure Of C Program A set of rules is defined for the C programs that are calledprotocols. The protocols help us to design the basic structure of a program. Here, I mentioned thebasic structure of a C program. Documentation section Link section Definition section Global declaration section Main function section Sub-program section All C programmers must follow theprotocols when writing any program. Let’s discuss all thebasic structure sections of a C program. Documentation Section The documentation section is a part of the program where the programmers provide the details about the program. In this section programmers usually give thename of the program and the details related to the program. This code gives an overview of the program. //program name /*This is a C Program*/ Link Section This section is used todeclare all theheader files that will be used in the program. 11/18
  • 12. It tells the compiler tolink the header files to the system library. #include<stdio.h> Definition Section In this section, we can define different types of constants. The keyword define is used to define a constant value in this part. #define PI=3.14 Global Declaration Section All the global variables are declared in this section. User-defined functions are also declared in this section of the code. int a,b,c; Main Function Section Every C-programs must have the main function. The main function contains 2 parts. 1. Declaration Part: All thevariables are declared in this part. 2. Execution Part: This part starts with thecurly brackets and ends with the curly close bracket. Both the declaration and the execution part are writing inside the curly braces. int main() { int a=5; printf(" %d", a); return 0; } Sub-program Section All user-defined functions are defined in this section. 12/18
  • 13. int add(int a, int b) { return a+b; } Hello World C Program This is the source code of a basic “Hello World” Program. 13/18
  • 14. #include<stdio.h> int main() { /*First basic C Program*/ printf("Hello World."); getch(); return 0; } After compiling the source code the output will be the following: Output: Hello World. Explanation of “Hello World” C Program Here, I explained each line of the “Hello World” C program. #include <stdio.h> This is a preprocessor command that includes the inputheader file from the C library before compiling a program. int main() This is the main function of executing any C program begins. { It represents the beginning of the main program. /*First basic C Program*/ If any words exist inside the command/* and */ in any C program that won’t be considered for compilation and execution. This is also called a comment line. printf(“Hello World.“); The printf command displays the words in the quote on the screen. getch(); This function is used to hold the output screen and wait until the user gives any type of input. So that we are able to see the output on the screen. return 0; 14/18
  • 15. Here, the return is a keyword that is used to return some value from a function. The main function returns an integer value, therefore here we are returning 0. It means our program has beenrun successfully and we terminate ourmain function with this return statement. } It represents the ending of the main program. Create a C Program Are you want to create and execute a C programs yourself? Then you need to follow the instructions: 1. At first, you need toinstall a C supported IDE (Integrated Development Environment) on your computer. 2. Once the IDE is installed on your computer, you canopen and create a C program. If you don’t want to install theIDE on your computer, you can use anonline compiler or IDE. The good thing about theonline compiler is it can compileC, C++, C#, Java, and many other programming languages. We also provide some links to the online and offlineIDE in this article that can help you to create and execute your C program easily. Best IDE For C 15/18
  • 16. You can create and edit C programs with any code editor or even a general editor. Yet, it is very important to choose thebest IDE for beginners. If the IDE is integrated with the C compiler, the process ofcreating and compiling the C program will be easier. Anyway, we collect some best IDE for c program that can help you to write and execute any c program easily. Here are some collection, Run C Program Online Onlinegdb IDE Tutorialspoint IDE Rextester IDE Run C Program On Android Phone TruboCdroid Cxxdroid TurboCPlus CppDroid Run C Program On Windows Turbo C++ Dev C++ 16/18
  • 17. Code::Blocks IDE Run C Program In Mac OS Turbo C++ Code::Blocks IDE Run C Program In Linux Code::Blocks IDE Choose the best IDE that makes youcomfortable to create and edit the C program. Thus, your programming skills will increase and you will be able tocreate any program within a few minutes. Advantages Of C Language It is one of the most useful programming languages when the system requires quick and direct access to the hardware. C is the most commonly used system withlimited resources (such as memory). Where performance is the most important attribute, C is the best choice for programmers. Disadvantages Of C Language C does not support OOP (Object-oriented programming) concepts, that’s why C++ is developed. There is no runtime checking ability in the C language. It only does compile-time checking. It does not support the concept of thenamespace. We cannot declare two variables of the same name without namespace. It does not have the concept ofconstructor and destructor. Uses Of C Language There are different types of uses of C language in programming. Some uses are the following: 17/18
  • 18. C mainly used to develop system software, operating systems, BIOS, Embedded Systems, Real-time systems. To develop application software like databases (MySQL) and 3D software (Autodesk Maya). Used to create graphical related applications like computers and mobile games. To evaluate any types of logical and mathematical equations using c language. UNIX kernel is completely made in C Language. The language is used to design different languagecompilers. Conclusion The C language doesn’t seem to have anexpiration date. It has a closeness to thehardware, great portability, and deterministic usage of resources. For these features, it is theideal programming language for low-level development of things like operating system kernels and embedded software. Its good performance, efficiency, and versatility make it anexcellent choice to develop highly complex data manipulation software like MySQL, 3D animation, and more. C is still unsurpassed where performance is the main priority. I hope now you know all thebasic information about the C language. 18/18