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
Ad

More Related Content

What's hot (20)

Basic C Programming language
Basic C Programming languageBasic C Programming language
Basic C Programming language
Abhishek Soni
 
Features of c language 1
Features of c language 1Features of c language 1
Features of c language 1
srmohan06
 
The smartpath information systems c pro
The smartpath information systems c proThe smartpath information systems c pro
The smartpath information systems c pro
The Smartpath Information Systems,Bhilai,Durg,Chhattisgarh.
 
Tokens_C
Tokens_CTokens_C
Tokens_C
Prabhu Govind
 
C Language
C LanguageC Language
C Language
Aakash Singh
 
C programming Training in Ambala ! Batra Computer Centre
C programming Training in Ambala ! Batra Computer CentreC programming Training in Ambala ! Batra Computer Centre
C programming Training in Ambala ! Batra Computer Centre
jatin batra
 
C notes for exam preparation
C notes for exam preparationC notes for exam preparation
C notes for exam preparation
Lakshmi Sarvani Videla
 
Structures
StructuresStructures
Structures
arshpreetkaur07
 
OpenGurukul : Language : C Programming
OpenGurukul : Language : C ProgrammingOpenGurukul : Language : C Programming
OpenGurukul : Language : C Programming
Open Gurukul
 
CProgrammingTutorial
CProgrammingTutorialCProgrammingTutorial
CProgrammingTutorial
Muthuselvam RS
 
C program
C programC program
C program
AJAL A J
 
Learn c language Important topics ( Easy & Logical, & smart way of learning)
Learn c language Important topics ( Easy & Logical, & smart way of learning)Learn c language Important topics ( Easy & Logical, & smart way of learning)
Learn c language Important topics ( Easy & Logical, & smart way of learning)
Rohit Singh
 
C language
C language C language
C language
COMSATS Institute of Information Technology
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programming
ABHISHEK fulwadhwa
 
C language introduction
C language introduction C language introduction
C language introduction
musrath mohammad
 
Fundamental of C Programming Language and Basic Input/Output Function
  Fundamental of C Programming Language and Basic Input/Output Function  Fundamental of C Programming Language and Basic Input/Output Function
Fundamental of C Programming Language and Basic Input/Output Function
imtiazalijoono
 
Introduction to C Programming - I
Introduction to C Programming - I Introduction to C Programming - I
Introduction to C Programming - I
vampugani
 
Features of c
Features of cFeatures of c
Features of c
Hitesh Kumar
 
Structure of c_program_to_input_output
Structure of c_program_to_input_outputStructure of c_program_to_input_output
Structure of c_program_to_input_output
Anil Dutt
 
Basic c
Basic cBasic c
Basic c
Veera Karthi
 
Basic C Programming language
Basic C Programming languageBasic C Programming language
Basic C Programming language
Abhishek Soni
 
Features of c language 1
Features of c language 1Features of c language 1
Features of c language 1
srmohan06
 
C programming Training in Ambala ! Batra Computer Centre
C programming Training in Ambala ! Batra Computer CentreC programming Training in Ambala ! Batra Computer Centre
C programming Training in Ambala ! Batra Computer Centre
jatin batra
 
OpenGurukul : Language : C Programming
OpenGurukul : Language : C ProgrammingOpenGurukul : Language : C Programming
OpenGurukul : Language : C Programming
Open Gurukul
 
Learn c language Important topics ( Easy & Logical, & smart way of learning)
Learn c language Important topics ( Easy & Logical, & smart way of learning)Learn c language Important topics ( Easy & Logical, & smart way of learning)
Learn c language Important topics ( Easy & Logical, & smart way of learning)
Rohit Singh
 
Fundamental of C Programming Language and Basic Input/Output Function
  Fundamental of C Programming Language and Basic Input/Output Function  Fundamental of C Programming Language and Basic Input/Output Function
Fundamental of C Programming Language and Basic Input/Output Function
imtiazalijoono
 
Introduction to C Programming - I
Introduction to C Programming - I Introduction to C Programming - I
Introduction to C Programming - I
vampugani
 
Structure of c_program_to_input_output
Structure of c_program_to_input_outputStructure of c_program_to_input_output
Structure of c_program_to_input_output
Anil Dutt
 

Similar to Basic Information About C language PDF (20)

programming for problem solving in C and C++.pptx
programming for problem solving in C and C++.pptxprogramming for problem solving in C and C++.pptx
programming for problem solving in C and C++.pptx
BamaSivasubramanianP
 
Interview Questions For C Language .pptx
Interview Questions For C Language .pptxInterview Questions For C Language .pptx
Interview Questions For C Language .pptx
Rowank2
 
C_Programming_Language_tutorial__Autosaved_.pptx
C_Programming_Language_tutorial__Autosaved_.pptxC_Programming_Language_tutorial__Autosaved_.pptx
C_Programming_Language_tutorial__Autosaved_.pptx
Likhil181
 
Interview Questions For C Language
Interview Questions For C Language Interview Questions For C Language
Interview Questions For C Language
Rowank2
 
UNIT 5 C PROGRAMMING, PROGRAM STRUCTURE
UNIT 5  C PROGRAMMING, PROGRAM STRUCTUREUNIT 5  C PROGRAMMING, PROGRAM STRUCTURE
UNIT 5 C PROGRAMMING, PROGRAM STRUCTURE
MUHUMUZAONAN1
 
C Programming Unit-1
C Programming Unit-1C Programming Unit-1
C Programming Unit-1
Vikram Nandini
 
C Programming Language Introduction and C Tokens.pdf
C Programming Language Introduction and C Tokens.pdfC Programming Language Introduction and C Tokens.pdf
C Programming Language Introduction and C Tokens.pdf
poongothai11
 
The New Yorker cartoon premium membership of the
The New Yorker cartoon premium membership of theThe New Yorker cartoon premium membership of the
The New Yorker cartoon premium membership of the
shubhamgupta7133
 
Aniket tore
Aniket toreAniket tore
Aniket tore
anikettore1
 
Unit 2 introduction to c programming
Unit 2   introduction to c programmingUnit 2   introduction to c programming
Unit 2 introduction to c programming
Mithun DSouza
 
C notes
C notesC notes
C notes
Raunak Sodhi
 
C programming language
C programming languageC programming language
C programming language
Abin Rimal
 
C Language Interview Questions: Data Types, Pointers, Data Structures, Memory...
C Language Interview Questions: Data Types, Pointers, Data Structures, Memory...C Language Interview Questions: Data Types, Pointers, Data Structures, Memory...
C Language Interview Questions: Data Types, Pointers, Data Structures, Memory...
Rowank2
 
unit 1 cpds.pptx
unit 1 cpds.pptxunit 1 cpds.pptx
unit 1 cpds.pptx
madhurij54
 
C language ppt
C language pptC language ppt
C language ppt
Ğäùråv Júñêjå
 
C prog ppt
C prog pptC prog ppt
C prog ppt
xinoe
 
C programming language tutorial for beginers.pdf
C programming language tutorial for beginers.pdfC programming language tutorial for beginers.pdf
C programming language tutorial for beginers.pdf
ComedyTechnology
 
Presentation 2.ppt
Presentation 2.pptPresentation 2.ppt
Presentation 2.ppt
UdhayaKumar175069
 
C tutorials
C tutorialsC tutorials
C tutorials
Amit Kapoor
 
history of c.ppt
history of c.ppthistory of c.ppt
history of c.ppt
arpanabharani
 
programming for problem solving in C and C++.pptx
programming for problem solving in C and C++.pptxprogramming for problem solving in C and C++.pptx
programming for problem solving in C and C++.pptx
BamaSivasubramanianP
 
Interview Questions For C Language .pptx
Interview Questions For C Language .pptxInterview Questions For C Language .pptx
Interview Questions For C Language .pptx
Rowank2
 
C_Programming_Language_tutorial__Autosaved_.pptx
C_Programming_Language_tutorial__Autosaved_.pptxC_Programming_Language_tutorial__Autosaved_.pptx
C_Programming_Language_tutorial__Autosaved_.pptx
Likhil181
 
Interview Questions For C Language
Interview Questions For C Language Interview Questions For C Language
Interview Questions For C Language
Rowank2
 
UNIT 5 C PROGRAMMING, PROGRAM STRUCTURE
UNIT 5  C PROGRAMMING, PROGRAM STRUCTUREUNIT 5  C PROGRAMMING, PROGRAM STRUCTURE
UNIT 5 C PROGRAMMING, PROGRAM STRUCTURE
MUHUMUZAONAN1
 
C Programming Language Introduction and C Tokens.pdf
C Programming Language Introduction and C Tokens.pdfC Programming Language Introduction and C Tokens.pdf
C Programming Language Introduction and C Tokens.pdf
poongothai11
 
The New Yorker cartoon premium membership of the
The New Yorker cartoon premium membership of theThe New Yorker cartoon premium membership of the
The New Yorker cartoon premium membership of the
shubhamgupta7133
 
Unit 2 introduction to c programming
Unit 2   introduction to c programmingUnit 2   introduction to c programming
Unit 2 introduction to c programming
Mithun DSouza
 
C programming language
C programming languageC programming language
C programming language
Abin Rimal
 
C Language Interview Questions: Data Types, Pointers, Data Structures, Memory...
C Language Interview Questions: Data Types, Pointers, Data Structures, Memory...C Language Interview Questions: Data Types, Pointers, Data Structures, Memory...
C Language Interview Questions: Data Types, Pointers, Data Structures, Memory...
Rowank2
 
unit 1 cpds.pptx
unit 1 cpds.pptxunit 1 cpds.pptx
unit 1 cpds.pptx
madhurij54
 
C prog ppt
C prog pptC prog ppt
C prog ppt
xinoe
 
C programming language tutorial for beginers.pdf
C programming language tutorial for beginers.pdfC programming language tutorial for beginers.pdf
C programming language tutorial for beginers.pdf
ComedyTechnology
 
Ad

Recently uploaded (20)

Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software DevelopmentSecure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Shubham Joshi
 
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Dele Amefo
 
Revolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptxRevolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptx
nidhisingh691197
 
Landscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature ReviewLandscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature Review
Hironori Washizaki
 
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
steaveroggers
 
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and CollaborateMeet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Maxim Salnikov
 
Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025
kashifyounis067
 
Douwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License codeDouwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License code
aneelaramzan63
 
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Lionel Briand
 
Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)
Allon Mureinik
 
FL Studio Producer Edition Crack 2025 Full Version
FL Studio Producer Edition Crack 2025 Full VersionFL Studio Producer Edition Crack 2025 Full Version
FL Studio Producer Edition Crack 2025 Full Version
tahirabibi60507
 
WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)
sh607827
 
EASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License CodeEASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License Code
aneelaramzan63
 
The Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdfThe Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdf
drewplanas10
 
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Orangescrum
 
Adobe Illustrator Crack FREE Download 2025 Latest Version
Adobe Illustrator Crack FREE Download 2025 Latest VersionAdobe Illustrator Crack FREE Download 2025 Latest Version
Adobe Illustrator Crack FREE Download 2025 Latest Version
kashifyounis067
 
Expand your AI adoption with AgentExchange
Expand your AI adoption with AgentExchangeExpand your AI adoption with AgentExchange
Expand your AI adoption with AgentExchange
Fexle Services Pvt. Ltd.
 
Download Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With LatestDownload Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With Latest
tahirabibi60507
 
Download YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full ActivatedDownload YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full Activated
saniamalik72555
 
Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]
saniaaftab72555
 
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software DevelopmentSecure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Shubham Joshi
 
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Dele Amefo
 
Revolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptxRevolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptx
nidhisingh691197
 
Landscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature ReviewLandscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature Review
Hironori Washizaki
 
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
steaveroggers
 
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and CollaborateMeet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Maxim Salnikov
 
Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025
kashifyounis067
 
Douwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License codeDouwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License code
aneelaramzan63
 
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Lionel Briand
 
Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)
Allon Mureinik
 
FL Studio Producer Edition Crack 2025 Full Version
FL Studio Producer Edition Crack 2025 Full VersionFL Studio Producer Edition Crack 2025 Full Version
FL Studio Producer Edition Crack 2025 Full Version
tahirabibi60507
 
WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)
sh607827
 
EASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License CodeEASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License Code
aneelaramzan63
 
The Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdfThe Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdf
drewplanas10
 
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Orangescrum
 
Adobe Illustrator Crack FREE Download 2025 Latest Version
Adobe Illustrator Crack FREE Download 2025 Latest VersionAdobe Illustrator Crack FREE Download 2025 Latest Version
Adobe Illustrator Crack FREE Download 2025 Latest Version
kashifyounis067
 
Expand your AI adoption with AgentExchange
Expand your AI adoption with AgentExchangeExpand your AI adoption with AgentExchange
Expand your AI adoption with AgentExchange
Fexle Services Pvt. Ltd.
 
Download Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With LatestDownload Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With Latest
tahirabibi60507
 
Download YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full ActivatedDownload YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full Activated
saniamalik72555
 
Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]
saniaaftab72555
 
Ad

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