SlideShare a Scribd company logo
1 of 32
Programming Language
Overview
C is a general-purpose, high-level language that was
originally developed by Dennis M. Ritchie to develop the
UNIX operating system at Bell Labs. C was originally first
implemented on the DEC PDP-11 computer in 1972.
In 1978, Brian Kernighan and Dennis Ritchie produced
the first publicly available description of C, now known as
the K&R standard.
Dennis MacAlistair Ritchie
 Dennis MacAlistair Ritchie (b. September 9,
1941; found dead October 12, 2011), was an
American computer scientist who "helped shape
the digital era." He created the C programming
language and, with long-time colleague Ken
Thompson, the UNIX operating system. Ritchie
and Thompson received the Turing Award from
the ACM in 1983, the Hamming Medal from
the IEEE in 1990 and the National Medal of
Technology from President Clinton in 1999.
Ritchie was the head of Lucent
TechnologiesSystem Software Research
Department when he retired in 2007. He was the
'R' in K&R C.
The UNIX operating system, the C compiler, and essentially
all UNIX application programs have been written in C. C has
now become a widely used professional language for various
reasons −
 Easy to learn
 Structured language
 It produces efficient programs
 It can handle low-level activities
 It can be compiled on a variety of computer platforms
Facts about C
o C was invented to write an operating system called UNIX.
o C is a successor of B language which was introduced around
the early 1970s.
o The language was formalized in 1988 by the American
National Standard Institute (ANSI).
o The UNIX OS was totally written in C.
o Today C is the most widely used and popular System
Programming Language.
o Most of the state-of-the-art software have been
implemented using C.
o Today's most popular Linux OS and RDBMS MySQL have been
written in C.
Why use C?
C was initially used for
system development work,
particularly the programs
that make-up the operating
system. C was adopted as a
system development language
because it produces code that
runs nearly as fast as the
code written in assembly
language. Some examples of
the use of C might be −
•Operating Systems
•Language Compilers
•Assemblers
•Text Editors
•Print Spoolers
•Network Drivers
•Modern Programs
•Databases
•Language Interpreters
•Utilities
Local Environment Setup
If you want to set up your environment for C
programming language, you need the following two
software tools available on your computer,
(a) Text Editor and (b) The C Compiler.
Text Editor
This will be used to type your program. Examples of few a
editors include Windows Notepad, OS Edit command, Brief,
Epsilon, EMACS, and vim or vi.
The name and version of text editors can vary on different
operating systems. For example, Notepad will be used on
Windows, and vim or vi can be used on windows as well as on
Linux or UNIX.
The files you create with your editor are called the source files
and they contain the program source codes. The source files
for C programs are typically named with the extension ".c".
Before starting your programming, make sure you have one
text editor in place and you have enough experience to write a
computer program, save it in a file, compile it and finally
execute it.
The C Compiler
The source code written in source file is the human readable
source for your program. It needs to be "compiled", into
machine language so that your CPU can actually execute the
program as per the instructions given.
The compiler compiles the source codes into final executable
programs. The most frequently used and free available
compiler is the GNU C/C++ compiler, otherwise you can have
compilers either from HP or Solaris if you have the respective
operating systems.
The following section explains how to install GNU C/C++
compiler on various OS. We keep mentioning C/C++ together
because GNU gcc compiler works for both C and C++
programming languages.
Installation on Windows
To install GCC on Windows, you need to install MinGW. To
install MinGW, go to the MinGW homepage, www.mingw.org,
and follow the link to the MinGW download page. Download
the latest version of the MinGW installation program, which
should be named MinGW-<version>.exe.
While installing Min GW, at a minimum, you must install gcc-
core, gcc-g++, binutils, and the MinGW runtime, but you may
wish to install more.
Add the bin subdirectory of your MinGW installation to
your PATH environment variable, so that you can specify these
tools on the command line by their simple names.
After the installation is complete, you will be able to run gcc,
g++, ar, ranlib, dlltool, and several other GNU tools from the
Windows command line.
DLL
Stands for "Dynamic Link Library." A DLL (.dll) file contains a library of
functions and other information that can be accessed by a Windows
program. When a program is launched, links to the necessary .dll files are
created. If a static link is created, the .dll files will be in use as long as
the program is active. If a dynamic link is created, the .dll files will only
be used when needed. Dynamic links help programs use resources, such
as memory and hard drive space, more efficiently.
DLL files can also be used by more than one program. In fact, they can
even be used by multiple programs at the same time. Some DLLs come
with the Windows operating system while others are added when new
programs are installed. You typically don't want to open a .dll file
directly, since the program that uses it will automatically load it if
needed. Though DLL filenames usually end in ".dll," they can also end in
.exe, .drv, and .fon, just to make things more confusing.
What is the difference between
.dll and .exe
.EXE
1).EXE is Executable File
2).exe is run individually
3).exe Has Main Function
4)Mainly is for standard alone application
.DLL
1)DLL is Dynamic Link Library
2)dll can't run individually
3)dll doesn't contain Main Function
4)dll give support to exe
Click to “mingw-get-setup.exe” then your file
will be start to download. After download
and open it…
After Installation go to “My Computer” or “This PC”
R-Click..
Edit and what should you paste here…..????
Think…….but don’t erase previous text path..
Write after this path due to press ‘;’ and paste
Path here that will be copied from “C:cygwinbin”
After paste above path then write ‘;’ and then
press ok.. ok.. ok..
Open “Command Prompt”
Hello World Example
A C program basically consists of the following
parts −
 Pre-processor Commands
 Functions
 Variables
 Statements & Expressions
 Comments
Let us look at a simple code that would
print the words "Hello World" −
o The first line of the program #include <stdio.h> is a pre-
processor command, which tells a C compiler to include
stdio.h file before going to actual compilation.
o The next line int main() is the main function where the
program execution begins.
o The next line /*...*/ will be ignored by the compiler and
it has been put to add additional comments in the
program. So such lines are called comments in the
program.
o The next line printf(...) is another function available in C
which causes the message "Hello, World!" to be displayed
on the screen.
o The next line return 0; terminates the main() function
and returns the value 0.
Compile and Execute C Program
Let us see how to save the source code in a file, and how
to compile and run it. Following are the simple steps −
o Open a text editor and add the above-mentioned code.
o Save the file as hello.c
o Open a command prompt and go to the directory where you have
saved the file.
o Type gcc hello.c and press enter to compile your code.
o If there are no errors in your code, the command prompt will
take you to the next line and would generate a.out executable
file.
o Now, type a.out to execute your program.
o You will see the output "Hello World" printed on the screen.
Open Text Editor and Command Prompt and
Type below command…..
Make sure the gcc compiler is in your path and that you
are running it in the directory containing the source file
hello.c.
Tokens in C
A C program consists of various tokens and a token is either a
keyword, an identifier, a constant, a string literal, or a symbol.
For example, the following C statement consists of five tokens −
Semicolons
In a C program, the semicolon is a statement terminator. That
is, each individual statement must be ended with a semicolon.
It indicates the end of one logical entity.
Comments
Comments are like helping text in your C program and they are
ignored by the compiler. They start with /* and terminate with
the characters */ as shown below −
Identifiers
A C identifier is a name used to identify a variable, function, or
any other user-defined item. An identifier starts with a letter A
to Z, a to z, or an underscore '_' followed by zero or more
letters, underscores, and digits (0 to 9).
C does not allow punctuation characters such as @, $, and %
within identifiers. C is a case-sensitive programming language.
Thus, Manpower and manpower are two different identifiers in
C. Here are some examples of acceptable identifiers −
Keywords The following list shows the reserved words in C. These reserved words
may not be used as constants or variables or any other identifier names.
Whitespace in C
A line containing only whitespace, possibly with a
comment, is known as a blank line, and a C compiler
totally ignores it.
Whitespace is the term used in C to describe blanks,
tabs, newline characters and comments. Whitespace
separates one part of a statement from another and
enables the compiler to identify where one element in a
statement, such as int, ends and the next element
begins. Therefore, in the following statement −
there must be at least one whitespace character (usually
a space) between int and age for the compiler to be
able to distinguish them. On the other hand, in the
following statement −
no whitespace characters are necessary between fruit
and =, or between = and apples, although you are free
to include some if you wish to increase readability.

More Related Content

What's hot

Introduction to c_language
Introduction to c_languageIntroduction to c_language
Introduction to c_languageWay2itech
 
Source vs object code
Source vs object codeSource vs object code
Source vs object codeSana Ullah
 
1 introduction to c programming language
1 introduction to c programming language1 introduction to c programming language
1 introduction to c programming languageNarendra Soni
 
Introduction to C Language
Introduction to C LanguageIntroduction to C Language
Introduction to C LanguageTarun Sharma
 
introduction to c programming language
introduction to c programming languageintroduction to c programming language
introduction to c programming languagesanjay joshi
 
Introduction to programming
Introduction to programmingIntroduction to programming
Introduction to programmingNeeru Mittal
 
File handling With Solve Programs
File handling With Solve ProgramsFile handling With Solve Programs
File handling With Solve ProgramsRohan Gajre
 
Programming Languages An Intro
Programming Languages An IntroProgramming Languages An Intro
Programming Languages An IntroKimberly De Guzman
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programmingAlpana Gupta
 
C introduction
C introductionC introduction
C introductionKamran
 
Introduction to c programming language
Introduction to c programming languageIntroduction to c programming language
Introduction to c programming languagesanjay joshi
 

What's hot (20)

Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
 
Introduction to c_language
Introduction to c_languageIntroduction to c_language
Introduction to c_language
 
Source vs object code
Source vs object codeSource vs object code
Source vs object code
 
1 introduction to c programming language
1 introduction to c programming language1 introduction to c programming language
1 introduction to c programming language
 
Introduction to C Language
Introduction to C LanguageIntroduction to C Language
Introduction to C Language
 
introduction to c programming language
introduction to c programming languageintroduction to c programming language
introduction to c programming language
 
Introduction to C# Programming
Introduction to C# ProgrammingIntroduction to C# Programming
Introduction to C# Programming
 
C Language
C LanguageC Language
C Language
 
Introduction to programming
Introduction to programmingIntroduction to programming
Introduction to programming
 
Unit 2 l1
Unit 2 l1Unit 2 l1
Unit 2 l1
 
C in7-days
C in7-daysC in7-days
C in7-days
 
C in7-days
C in7-daysC in7-days
C in7-days
 
C basics
C   basicsC   basics
C basics
 
File handling With Solve Programs
File handling With Solve ProgramsFile handling With Solve Programs
File handling With Solve Programs
 
Ctutor ashu
Ctutor ashuCtutor ashu
Ctutor ashu
 
Programming Languages An Intro
Programming Languages An IntroProgramming Languages An Intro
Programming Languages An Intro
 
Cp week _2.
Cp week _2.Cp week _2.
Cp week _2.
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programming
 
C introduction
C introductionC introduction
C introduction
 
Introduction to c programming language
Introduction to c programming languageIntroduction to c programming language
Introduction to c programming language
 

Similar to C

Introduction of c language
Introduction of c languageIntroduction of c language
Introduction of c languagefarishah
 
INTRODUCTION TO C PROGRAMMING MATERIAL.pdf
INTRODUCTION TO C PROGRAMMING MATERIAL.pdfINTRODUCTION TO C PROGRAMMING MATERIAL.pdf
INTRODUCTION TO C PROGRAMMING MATERIAL.pdfSubramanyambharathis
 
Diploma ii cfpc u-1 introduction to c language
Diploma ii  cfpc u-1 introduction to c languageDiploma ii  cfpc u-1 introduction to c language
Diploma ii cfpc u-1 introduction to c languageRai University
 
Bsc cs i pic u-1 introduction to c language
Bsc cs i pic u-1 introduction to c languageBsc cs i pic u-1 introduction to c language
Bsc cs i pic u-1 introduction to c languageRai University
 
Btech i pic u-1 introduction to c language
Btech i pic u-1 introduction to c languageBtech i pic u-1 introduction to c language
Btech i pic u-1 introduction to c languageRai University
 
introduction to c language
 introduction to c language introduction to c language
introduction to c languageRai University
 
Mca i pic u-1 introduction to c language
Mca i pic u-1 introduction to c languageMca i pic u-1 introduction to c language
Mca i pic u-1 introduction to c languageRai University
 
His162013 140529214456-phpapp01
His162013 140529214456-phpapp01His162013 140529214456-phpapp01
His162013 140529214456-phpapp01Getachew Ganfur
 
C Programming UNIT 1.pptx
C Programming  UNIT 1.pptxC Programming  UNIT 1.pptx
C Programming UNIT 1.pptxMugilvannan11
 
C-PROGRAMMING-LANGUAGE.pptx
C-PROGRAMMING-LANGUAGE.pptxC-PROGRAMMING-LANGUAGE.pptx
C-PROGRAMMING-LANGUAGE.pptxDhirendraShahi2
 
C plus plus for hackers it security
C plus plus for hackers it securityC plus plus for hackers it security
C plus plus for hackers it securityCESAR A. RUIZ C
 
The C++ Programming Language
The C++ Programming LanguageThe C++ Programming Language
The C++ Programming LanguageProf Ansari
 

Similar to C (20)

Introduction of c language
Introduction of c languageIntroduction of c language
Introduction of c language
 
Introduction to c language
Introduction to c language Introduction to c language
Introduction to c language
 
INTRODUCTION TO C PROGRAMMING MATERIAL.pdf
INTRODUCTION TO C PROGRAMMING MATERIAL.pdfINTRODUCTION TO C PROGRAMMING MATERIAL.pdf
INTRODUCTION TO C PROGRAMMING MATERIAL.pdf
 
Diploma ii cfpc u-1 introduction to c language
Diploma ii  cfpc u-1 introduction to c languageDiploma ii  cfpc u-1 introduction to c language
Diploma ii cfpc u-1 introduction to c language
 
Session 1 - c++ intro
Session   1 - c++ introSession   1 - c++ intro
Session 1 - c++ intro
 
Bsc cs i pic u-1 introduction to c language
Bsc cs i pic u-1 introduction to c languageBsc cs i pic u-1 introduction to c language
Bsc cs i pic u-1 introduction to c language
 
Btech i pic u-1 introduction to c language
Btech i pic u-1 introduction to c languageBtech i pic u-1 introduction to c language
Btech i pic u-1 introduction to c language
 
introduction to c language
 introduction to c language introduction to c language
introduction to c language
 
The basics of c programming
The basics of c programmingThe basics of c programming
The basics of c programming
 
Mca i pic u-1 introduction to c language
Mca i pic u-1 introduction to c languageMca i pic u-1 introduction to c language
Mca i pic u-1 introduction to c language
 
C++ for hackers
C++ for hackersC++ for hackers
C++ for hackers
 
His162013 140529214456-phpapp01
His162013 140529214456-phpapp01His162013 140529214456-phpapp01
His162013 140529214456-phpapp01
 
C Fundamental.docx
C Fundamental.docxC Fundamental.docx
C Fundamental.docx
 
C Programming UNIT 1.pptx
C Programming  UNIT 1.pptxC Programming  UNIT 1.pptx
C Programming UNIT 1.pptx
 
Programming in c
Programming in cProgramming in c
Programming in c
 
C-PROGRAMMING-LANGUAGE.pptx
C-PROGRAMMING-LANGUAGE.pptxC-PROGRAMMING-LANGUAGE.pptx
C-PROGRAMMING-LANGUAGE.pptx
 
C language
C languageC language
C language
 
C plus plus for hackers it security
C plus plus for hackers it securityC plus plus for hackers it security
C plus plus for hackers it security
 
The C++ Programming Language
The C++ Programming LanguageThe C++ Programming Language
The C++ Programming Language
 
CS3251-_PIC
CS3251-_PICCS3251-_PIC
CS3251-_PIC
 

Recently uploaded

Digital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptxDigital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptxpritamlangde
 
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...drmkjayanthikannan
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdfKamal Acharya
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityMorshed Ahmed Rahath
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueBhangaleSonal
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdfKamal Acharya
 
💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...
💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...
💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...vershagrag
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationBhangaleSonal
 
Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...
Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...
Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...jabtakhaidam7
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfJiananWang21
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Call Girls Mumbai
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VDineshKumar4165
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTbhaskargani46
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startQuintin Balsdon
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptxJIT KUMAR GUPTA
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesMayuraD1
 
Introduction to Data Visualization,Matplotlib.pdf
Introduction to Data Visualization,Matplotlib.pdfIntroduction to Data Visualization,Matplotlib.pdf
Introduction to Data Visualization,Matplotlib.pdfsumitt6_25730773
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.Kamal Acharya
 

Recently uploaded (20)

Digital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptxDigital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptx
 
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdf
 
💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...
💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...
💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...
Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...
Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
Introduction to Data Visualization,Matplotlib.pdf
Introduction to Data Visualization,Matplotlib.pdfIntroduction to Data Visualization,Matplotlib.pdf
Introduction to Data Visualization,Matplotlib.pdf
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 

C

  • 2. Overview C is a general-purpose, high-level language that was originally developed by Dennis M. Ritchie to develop the UNIX operating system at Bell Labs. C was originally first implemented on the DEC PDP-11 computer in 1972. In 1978, Brian Kernighan and Dennis Ritchie produced the first publicly available description of C, now known as the K&R standard.
  • 3. Dennis MacAlistair Ritchie  Dennis MacAlistair Ritchie (b. September 9, 1941; found dead October 12, 2011), was an American computer scientist who "helped shape the digital era." He created the C programming language and, with long-time colleague Ken Thompson, the UNIX operating system. Ritchie and Thompson received the Turing Award from the ACM in 1983, the Hamming Medal from the IEEE in 1990 and the National Medal of Technology from President Clinton in 1999. Ritchie was the head of Lucent TechnologiesSystem Software Research Department when he retired in 2007. He was the 'R' in K&R C.
  • 4. The UNIX operating system, the C compiler, and essentially all UNIX application programs have been written in C. C has now become a widely used professional language for various reasons −  Easy to learn  Structured language  It produces efficient programs  It can handle low-level activities  It can be compiled on a variety of computer platforms
  • 5. Facts about C o C was invented to write an operating system called UNIX. o C is a successor of B language which was introduced around the early 1970s. o The language was formalized in 1988 by the American National Standard Institute (ANSI). o The UNIX OS was totally written in C. o Today C is the most widely used and popular System Programming Language. o Most of the state-of-the-art software have been implemented using C. o Today's most popular Linux OS and RDBMS MySQL have been written in C.
  • 6. Why use C? C was initially used for system development work, particularly the programs that make-up the operating system. C was adopted as a system development language because it produces code that runs nearly as fast as the code written in assembly language. Some examples of the use of C might be − •Operating Systems •Language Compilers •Assemblers •Text Editors •Print Spoolers •Network Drivers •Modern Programs •Databases •Language Interpreters •Utilities
  • 7. Local Environment Setup If you want to set up your environment for C programming language, you need the following two software tools available on your computer, (a) Text Editor and (b) The C Compiler.
  • 8. Text Editor This will be used to type your program. Examples of few a editors include Windows Notepad, OS Edit command, Brief, Epsilon, EMACS, and vim or vi. The name and version of text editors can vary on different operating systems. For example, Notepad will be used on Windows, and vim or vi can be used on windows as well as on Linux or UNIX. The files you create with your editor are called the source files and they contain the program source codes. The source files for C programs are typically named with the extension ".c". Before starting your programming, make sure you have one text editor in place and you have enough experience to write a computer program, save it in a file, compile it and finally execute it.
  • 9. The C Compiler The source code written in source file is the human readable source for your program. It needs to be "compiled", into machine language so that your CPU can actually execute the program as per the instructions given. The compiler compiles the source codes into final executable programs. The most frequently used and free available compiler is the GNU C/C++ compiler, otherwise you can have compilers either from HP or Solaris if you have the respective operating systems. The following section explains how to install GNU C/C++ compiler on various OS. We keep mentioning C/C++ together because GNU gcc compiler works for both C and C++ programming languages.
  • 10. Installation on Windows To install GCC on Windows, you need to install MinGW. To install MinGW, go to the MinGW homepage, www.mingw.org, and follow the link to the MinGW download page. Download the latest version of the MinGW installation program, which should be named MinGW-<version>.exe. While installing Min GW, at a minimum, you must install gcc- core, gcc-g++, binutils, and the MinGW runtime, but you may wish to install more. Add the bin subdirectory of your MinGW installation to your PATH environment variable, so that you can specify these tools on the command line by their simple names. After the installation is complete, you will be able to run gcc, g++, ar, ranlib, dlltool, and several other GNU tools from the Windows command line.
  • 11. DLL Stands for "Dynamic Link Library." A DLL (.dll) file contains a library of functions and other information that can be accessed by a Windows program. When a program is launched, links to the necessary .dll files are created. If a static link is created, the .dll files will be in use as long as the program is active. If a dynamic link is created, the .dll files will only be used when needed. Dynamic links help programs use resources, such as memory and hard drive space, more efficiently. DLL files can also be used by more than one program. In fact, they can even be used by multiple programs at the same time. Some DLLs come with the Windows operating system while others are added when new programs are installed. You typically don't want to open a .dll file directly, since the program that uses it will automatically load it if needed. Though DLL filenames usually end in ".dll," they can also end in .exe, .drv, and .fon, just to make things more confusing.
  • 12. What is the difference between .dll and .exe .EXE 1).EXE is Executable File 2).exe is run individually 3).exe Has Main Function 4)Mainly is for standard alone application .DLL 1)DLL is Dynamic Link Library 2)dll can't run individually 3)dll doesn't contain Main Function 4)dll give support to exe
  • 13.
  • 14. Click to “mingw-get-setup.exe” then your file will be start to download. After download and open it…
  • 15.
  • 16.
  • 17.
  • 18. After Installation go to “My Computer” or “This PC” R-Click..
  • 19. Edit and what should you paste here…..???? Think…….but don’t erase previous text path.. Write after this path due to press ‘;’ and paste Path here that will be copied from “C:cygwinbin” After paste above path then write ‘;’ and then press ok.. ok.. ok.. Open “Command Prompt”
  • 20.
  • 21.
  • 22.
  • 23. Hello World Example A C program basically consists of the following parts −  Pre-processor Commands  Functions  Variables  Statements & Expressions  Comments
  • 24. Let us look at a simple code that would print the words "Hello World" − o The first line of the program #include <stdio.h> is a pre- processor command, which tells a C compiler to include stdio.h file before going to actual compilation. o The next line int main() is the main function where the program execution begins. o The next line /*...*/ will be ignored by the compiler and it has been put to add additional comments in the program. So such lines are called comments in the program. o The next line printf(...) is another function available in C which causes the message "Hello, World!" to be displayed on the screen. o The next line return 0; terminates the main() function and returns the value 0.
  • 25. Compile and Execute C Program Let us see how to save the source code in a file, and how to compile and run it. Following are the simple steps − o Open a text editor and add the above-mentioned code. o Save the file as hello.c o Open a command prompt and go to the directory where you have saved the file. o Type gcc hello.c and press enter to compile your code. o If there are no errors in your code, the command prompt will take you to the next line and would generate a.out executable file. o Now, type a.out to execute your program. o You will see the output "Hello World" printed on the screen.
  • 26. Open Text Editor and Command Prompt and Type below command….. Make sure the gcc compiler is in your path and that you are running it in the directory containing the source file hello.c.
  • 27. Tokens in C A C program consists of various tokens and a token is either a keyword, an identifier, a constant, a string literal, or a symbol. For example, the following C statement consists of five tokens −
  • 28. Semicolons In a C program, the semicolon is a statement terminator. That is, each individual statement must be ended with a semicolon. It indicates the end of one logical entity. Comments Comments are like helping text in your C program and they are ignored by the compiler. They start with /* and terminate with the characters */ as shown below −
  • 29. Identifiers A C identifier is a name used to identify a variable, function, or any other user-defined item. An identifier starts with a letter A to Z, a to z, or an underscore '_' followed by zero or more letters, underscores, and digits (0 to 9). C does not allow punctuation characters such as @, $, and % within identifiers. C is a case-sensitive programming language. Thus, Manpower and manpower are two different identifiers in C. Here are some examples of acceptable identifiers −
  • 30. Keywords The following list shows the reserved words in C. These reserved words may not be used as constants or variables or any other identifier names.
  • 31. Whitespace in C A line containing only whitespace, possibly with a comment, is known as a blank line, and a C compiler totally ignores it. Whitespace is the term used in C to describe blanks, tabs, newline characters and comments. Whitespace separates one part of a statement from another and enables the compiler to identify where one element in a statement, such as int, ends and the next element begins. Therefore, in the following statement −
  • 32. there must be at least one whitespace character (usually a space) between int and age for the compiler to be able to distinguish them. On the other hand, in the following statement − no whitespace characters are necessary between fruit and =, or between = and apples, although you are free to include some if you wish to increase readability.