SlideShare a Scribd company logo
A PRESENTATION ON
“C LANGUAGE”
SUBMITTED BY:- MOHIT
SANKHLA
SECTION:- B
CS DEPARTMENT
SUBMITTED TO:- PAWAN KUMAR
PATIDAR
OVER VIEW OF C
»C is developed by Dennis Ritchie.
»C is a structured programming language.
»C supports functions that enables easy maintainability of code,
by breaking large file into smaller modules.
»Comments in C provides easy readability.
»C is a powerful language.
PROGRAM STRUCTURE
A sample C Program
#include<stdio.h>
int main()
{
--other statements
// Comments after double slash
}
HEADER FILES
»The files that are specified in the include section is called as
header file.
»These are precompiled files that has some functions defined in
them.
»We can call those functions in our program by supplying
parameters.
»Header file is given an extension .h.
MAIN FUNCTION
»This is the entry point of a program.
»When a file is executed, the start point is the main function
»From main function the flow goes as per the programmers
choice.
»There may or may not be other functions written by user in a
program
»Main function is compulsory for any c program
WRITING THE FIRST PROGRAM
#include<stdio.h>
int main()
{
printf(“Hello”);
return 0;
}
»This program will print hello on the screen when we
execute it.
RUNNING A C PROGRAM
»Type a program.
»Save it.
»Compile the program – This will generate an exe file
(executable).
»Run the program (Actually the exe created out of compilation
will run and not the .c file).
»In different compiler we have different option for compiling and
running. We give only the concepts.
COMMENTS IN C
»Single line comment
– // (double slash)
– Termination of comment is by pressing enter key.
»Multi line comment
/*….
…….*/
»This can span over to multiple lines.
DATATYPES IN C
»Primitive data types
– int, float, double, char
»Aggregate data types
– Arrays come under this category
– Arrays can contain collection of int or float or char or
double data
»User defined data types
– Structures and enum fall under this category.
FOR LOOPS
The syntax of for loop is
for(initialisation ; condition checking ; increment)
{
set of statements
}
WHILE LOOP
The syntax for while loop
while(condition)
{
statements;
}
DO WHILE LOOP
The syntax of do while loop
do
{
set of statements
}while(condition);
ARRAYS
»Arrays fall under aggregate data type
»Aggregate – More than 1
»Arrays are collection of data that belong to same data type
»Arrays are collection of homogeneous data.
»int a[5] is an array that stores 5 integers.
»a[0] is the first element where as a[4] is the fifth element.
»float a[5][5] is a two dimensional array. It can store 5x5 = 25
floating point numbers.
STRUCTURES
»Structures are user defined data types.
»It is a collection of heterogeneous data.
»It can have integer, float, double or character data in it.
»We can also have array of structures
struct <<structname>>
{
members;
}element;
POINTERS
»Pointer is a special variable that stores address of another
variable.
»Addresses are integers. Hence pointer stores integer data.
»Size of pointer = size of int
CALL BY REFERENCE
Calling a function with parameters passed as values
int a=10; void fun(int a)
fun(a); {
definition;
}
Here fun(a) is a call by value.
Any modification done with in the function is local to it and will
not be effected outside the function.
EXAMPLE PROGRAM – CALL BY
REFERENCE
#include<stdio.h>
void main()
{
int a=10;
printf(“%d”,a); a=10
fun(a);
printf(“%d”,a); a=10
}
void fun(int x)
{
printf(“%d”,x) x=10
x++;
printf(“%d”,x); x=11
}
CALL BY REFERENCE
Calling a function by passing pointers as parameters (address of
variables is passed instead of variables).
int a=1; void fun(int *x)
fun(&a);
{
defn;
}
Any modification done to variable a will effect outside the
function also.
EXAMPLE PROGRAM – CALL BY
REFERENCE
#include<stdio.h>
void main()
{
int a=10;
printf(“%d”,a); a=10
fun(a);
printf(“%d”,a); a=11
}
void fun(int x)
{
printf(“%d”,x) x=10
printf(“%d”,x); x=11
}
a and x are referring to same
location. So value will be over
written.
THANK YOU!
QUERIES?

More Related Content

What's hot

Structure in c
Structure in cStructure in c
Understanding the components of standard template library
Understanding the components of standard template libraryUnderstanding the components of standard template library
Understanding the components of standard template library
Rahul Sharma
 
Session 17 - Collections - Lists, Sets
Session 17 - Collections - Lists, SetsSession 17 - Collections - Lists, Sets
Session 17 - Collections - Lists, Sets
PawanMM
 
Files in java
Files in javaFiles in java
14 file handling
14 file handling14 file handling
14 file handling
APU
 
Structure in C language
Structure in C languageStructure in C language
Structure in C language
CGC Technical campus,Mohali
 
An introduction to java programming
An introduction to java programmingAn introduction to java programming
An introduction to java programming
hoshmand kareem
 
Assets, files, and data parsing
Assets, files, and data parsingAssets, files, and data parsing
Assets, files, and data parsing
Aly Arman
 
C programing -Structure
C programing -StructureC programing -Structure
C programing -Structure
shaibal sharif
 
Type Casting C# - Lec4 (Workshop on C# Programming: Learn to Build)
Type Casting C# - Lec4 (Workshop on C# Programming: Learn to Build)Type Casting C# - Lec4 (Workshop on C# Programming: Learn to Build)
Type Casting C# - Lec4 (Workshop on C# Programming: Learn to Build)
Jannat Ruma
 
2CPP16 - STL
2CPP16 - STL2CPP16 - STL
2CPP16 - STL
Michael Heron
 
Streams&amp;io
Streams&amp;ioStreams&amp;io
Streams&amp;io
PhD Research Scholar
 
Data Type C# - Lec2 (Workshop on C# Programming: Learn to Build)
Data Type C# - Lec2 (Workshop on C# Programming: Learn to Build)Data Type C# - Lec2 (Workshop on C# Programming: Learn to Build)
Data Type C# - Lec2 (Workshop on C# Programming: Learn to Build)
Jannat Ruma
 
An Introduction to the C++ Standard Library
An Introduction to the C++ Standard LibraryAn Introduction to the C++ Standard Library
An Introduction to the C++ Standard Library
Joyjit Choudhury
 
C# Basic - Lec1 (Workshop on C# Programming: Learn to Build)
C# Basic - Lec1 (Workshop on C# Programming: Learn to Build)C# Basic - Lec1 (Workshop on C# Programming: Learn to Build)
C# Basic - Lec1 (Workshop on C# Programming: Learn to Build)
Jannat Ruma
 
Structure in c
Structure in cStructure in c
Structure in c
Prabhu Govind
 
C# File IO Operations
C# File IO OperationsC# File IO Operations
C# File IO Operations
Prem Kumar Badri
 
Design patterns for beginners (1/ 2)
Design patterns for beginners (1/ 2)Design patterns for beginners (1/ 2)
Design patterns for beginners (1/ 2)
Mustapha Tachouct
 
Java stereams
Java stereamsJava stereams
Java stereams
Jernej Virag
 
Javaiostream
JavaiostreamJavaiostream
Javaiostream
Tien Nguyen
 

What's hot (20)

Structure in c
Structure in cStructure in c
Structure in c
 
Understanding the components of standard template library
Understanding the components of standard template libraryUnderstanding the components of standard template library
Understanding the components of standard template library
 
Session 17 - Collections - Lists, Sets
Session 17 - Collections - Lists, SetsSession 17 - Collections - Lists, Sets
Session 17 - Collections - Lists, Sets
 
Files in java
Files in javaFiles in java
Files in java
 
14 file handling
14 file handling14 file handling
14 file handling
 
Structure in C language
Structure in C languageStructure in C language
Structure in C language
 
An introduction to java programming
An introduction to java programmingAn introduction to java programming
An introduction to java programming
 
Assets, files, and data parsing
Assets, files, and data parsingAssets, files, and data parsing
Assets, files, and data parsing
 
C programing -Structure
C programing -StructureC programing -Structure
C programing -Structure
 
Type Casting C# - Lec4 (Workshop on C# Programming: Learn to Build)
Type Casting C# - Lec4 (Workshop on C# Programming: Learn to Build)Type Casting C# - Lec4 (Workshop on C# Programming: Learn to Build)
Type Casting C# - Lec4 (Workshop on C# Programming: Learn to Build)
 
2CPP16 - STL
2CPP16 - STL2CPP16 - STL
2CPP16 - STL
 
Streams&amp;io
Streams&amp;ioStreams&amp;io
Streams&amp;io
 
Data Type C# - Lec2 (Workshop on C# Programming: Learn to Build)
Data Type C# - Lec2 (Workshop on C# Programming: Learn to Build)Data Type C# - Lec2 (Workshop on C# Programming: Learn to Build)
Data Type C# - Lec2 (Workshop on C# Programming: Learn to Build)
 
An Introduction to the C++ Standard Library
An Introduction to the C++ Standard LibraryAn Introduction to the C++ Standard Library
An Introduction to the C++ Standard Library
 
C# Basic - Lec1 (Workshop on C# Programming: Learn to Build)
C# Basic - Lec1 (Workshop on C# Programming: Learn to Build)C# Basic - Lec1 (Workshop on C# Programming: Learn to Build)
C# Basic - Lec1 (Workshop on C# Programming: Learn to Build)
 
Structure in c
Structure in cStructure in c
Structure in c
 
C# File IO Operations
C# File IO OperationsC# File IO Operations
C# File IO Operations
 
Design patterns for beginners (1/ 2)
Design patterns for beginners (1/ 2)Design patterns for beginners (1/ 2)
Design patterns for beginners (1/ 2)
 
Java stereams
Java stereamsJava stereams
Java stereams
 
Javaiostream
JavaiostreamJavaiostream
Javaiostream
 

Similar to Persentation on c language

C programming
C programmingC programming
C programming
Nazmus Shakib Shadin
 
Exception Handling ,templates in C++
Exception Handling ,templates in C++Exception Handling ,templates in C++
Exception Handling ,templates in C++
jamilmalik19
 
cs8251 unit 1 ppt
cs8251 unit 1 pptcs8251 unit 1 ppt
cs8251 unit 1 ppt
praveenaprakasam
 
Basics of Programming.pptx
Basics of Programming.pptxBasics of Programming.pptx
Basics of Programming.pptx
SoumitraChakraborty28
 
Python training
Python trainingPython training
Python training
Kunalchauhan76
 
object oriented programming part inheritance.pptx
object oriented programming part inheritance.pptxobject oriented programming part inheritance.pptx
object oriented programming part inheritance.pptx
urvashipundir04
 
Data Types in C++-Primary or Built-in or Fundamental data type Derived data t...
Data Types in C++-Primary or Built-in or Fundamental data type Derived data t...Data Types in C++-Primary or Built-in or Fundamental data type Derived data t...
Data Types in C++-Primary or Built-in or Fundamental data type Derived data t...
ssuser5610081
 
Programming Language
Programming  LanguageProgramming  Language
Programming Language
Adeel Hamid
 
Presentation c++
Presentation c++Presentation c++
Presentation c++
JosephAlex21
 
pythontraining-201jn026043638.pptx
pythontraining-201jn026043638.pptxpythontraining-201jn026043638.pptx
pythontraining-201jn026043638.pptx
RohitKumar639388
 
Technical Interview
Technical InterviewTechnical Interview
Technical Interview
prashant patel
 
Oop(object oriented programming)
Oop(object oriented programming)Oop(object oriented programming)
Oop(object oriented programming)
geetika goyal
 
Lect1.pptx
Lect1.pptxLect1.pptx
Learn advanced java programming
Learn advanced java programmingLearn advanced java programming
Learn advanced java programming
TOPS Technologies
 
Advanced programming ch2
Advanced programming ch2Advanced programming ch2
Advanced programming ch2
Gera Paulos
 
Ppt programming by alyssa marie paral
Ppt programming by alyssa marie paralPpt programming by alyssa marie paral
Ppt programming by alyssa marie paral
alyssamarieparal
 
Lex tool manual
Lex tool manualLex tool manual
Lex tool manual
Sami Said
 
Data structures and algorithms 2
Data structures and algorithms 2 Data structures and algorithms 2
Data structures and algorithms 2
Mark John Lado, MIT
 
Apache Solr Workshop
Apache Solr WorkshopApache Solr Workshop
Apache Solr Workshop
Saumitra Srivastav
 
c++ Unit I.pptx
c++ Unit I.pptxc++ Unit I.pptx

Similar to Persentation on c language (20)

C programming
C programmingC programming
C programming
 
Exception Handling ,templates in C++
Exception Handling ,templates in C++Exception Handling ,templates in C++
Exception Handling ,templates in C++
 
cs8251 unit 1 ppt
cs8251 unit 1 pptcs8251 unit 1 ppt
cs8251 unit 1 ppt
 
Basics of Programming.pptx
Basics of Programming.pptxBasics of Programming.pptx
Basics of Programming.pptx
 
Python training
Python trainingPython training
Python training
 
object oriented programming part inheritance.pptx
object oriented programming part inheritance.pptxobject oriented programming part inheritance.pptx
object oriented programming part inheritance.pptx
 
Data Types in C++-Primary or Built-in or Fundamental data type Derived data t...
Data Types in C++-Primary or Built-in or Fundamental data type Derived data t...Data Types in C++-Primary or Built-in or Fundamental data type Derived data t...
Data Types in C++-Primary or Built-in or Fundamental data type Derived data t...
 
Programming Language
Programming  LanguageProgramming  Language
Programming Language
 
Presentation c++
Presentation c++Presentation c++
Presentation c++
 
pythontraining-201jn026043638.pptx
pythontraining-201jn026043638.pptxpythontraining-201jn026043638.pptx
pythontraining-201jn026043638.pptx
 
Technical Interview
Technical InterviewTechnical Interview
Technical Interview
 
Oop(object oriented programming)
Oop(object oriented programming)Oop(object oriented programming)
Oop(object oriented programming)
 
Lect1.pptx
Lect1.pptxLect1.pptx
Lect1.pptx
 
Learn advanced java programming
Learn advanced java programmingLearn advanced java programming
Learn advanced java programming
 
Advanced programming ch2
Advanced programming ch2Advanced programming ch2
Advanced programming ch2
 
Ppt programming by alyssa marie paral
Ppt programming by alyssa marie paralPpt programming by alyssa marie paral
Ppt programming by alyssa marie paral
 
Lex tool manual
Lex tool manualLex tool manual
Lex tool manual
 
Data structures and algorithms 2
Data structures and algorithms 2 Data structures and algorithms 2
Data structures and algorithms 2
 
Apache Solr Workshop
Apache Solr WorkshopApache Solr Workshop
Apache Solr Workshop
 
c++ Unit I.pptx
c++ Unit I.pptxc++ Unit I.pptx
c++ Unit I.pptx
 

Recently uploaded

AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
Google
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
Peter Muessig
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptxLORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
lorraineandreiamcidl
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
Peter Muessig
 
DDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systemsDDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systems
Gerardo Pardo-Castellote
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Crescat
 
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdfRevolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Undress Baby
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Neo4j
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
Sven Peters
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
Rakesh Kumar R
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
Łukasz Chruściel
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
TheSMSPoint
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
lorraineandreiamcidl
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
mz5nrf0n
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
rodomar2
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
Aftab Hussain
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
Neo4j
 
Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
Grant Fritchey
 

Recently uploaded (20)

AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptxLORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
 
DDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systemsDDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systems
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
 
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdfRevolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
 
Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
 

Persentation on c language

  • 1. A PRESENTATION ON “C LANGUAGE” SUBMITTED BY:- MOHIT SANKHLA SECTION:- B CS DEPARTMENT SUBMITTED TO:- PAWAN KUMAR PATIDAR
  • 2. OVER VIEW OF C »C is developed by Dennis Ritchie. »C is a structured programming language. »C supports functions that enables easy maintainability of code, by breaking large file into smaller modules. »Comments in C provides easy readability. »C is a powerful language.
  • 3. PROGRAM STRUCTURE A sample C Program #include<stdio.h> int main() { --other statements // Comments after double slash }
  • 4. HEADER FILES »The files that are specified in the include section is called as header file. »These are precompiled files that has some functions defined in them. »We can call those functions in our program by supplying parameters. »Header file is given an extension .h.
  • 5. MAIN FUNCTION »This is the entry point of a program. »When a file is executed, the start point is the main function »From main function the flow goes as per the programmers choice. »There may or may not be other functions written by user in a program »Main function is compulsory for any c program
  • 6. WRITING THE FIRST PROGRAM #include<stdio.h> int main() { printf(“Hello”); return 0; } »This program will print hello on the screen when we execute it.
  • 7. RUNNING A C PROGRAM »Type a program. »Save it. »Compile the program – This will generate an exe file (executable). »Run the program (Actually the exe created out of compilation will run and not the .c file). »In different compiler we have different option for compiling and running. We give only the concepts.
  • 8. COMMENTS IN C »Single line comment – // (double slash) – Termination of comment is by pressing enter key. »Multi line comment /*…. …….*/ »This can span over to multiple lines.
  • 9. DATATYPES IN C »Primitive data types – int, float, double, char »Aggregate data types – Arrays come under this category – Arrays can contain collection of int or float or char or double data »User defined data types – Structures and enum fall under this category.
  • 10. FOR LOOPS The syntax of for loop is for(initialisation ; condition checking ; increment) { set of statements }
  • 11. WHILE LOOP The syntax for while loop while(condition) { statements; }
  • 12. DO WHILE LOOP The syntax of do while loop do { set of statements }while(condition);
  • 13. ARRAYS »Arrays fall under aggregate data type »Aggregate – More than 1 »Arrays are collection of data that belong to same data type »Arrays are collection of homogeneous data. »int a[5] is an array that stores 5 integers. »a[0] is the first element where as a[4] is the fifth element. »float a[5][5] is a two dimensional array. It can store 5x5 = 25 floating point numbers.
  • 14. STRUCTURES »Structures are user defined data types. »It is a collection of heterogeneous data. »It can have integer, float, double or character data in it. »We can also have array of structures struct <<structname>> { members; }element;
  • 15. POINTERS »Pointer is a special variable that stores address of another variable. »Addresses are integers. Hence pointer stores integer data. »Size of pointer = size of int
  • 16. CALL BY REFERENCE Calling a function with parameters passed as values int a=10; void fun(int a) fun(a); { definition; } Here fun(a) is a call by value. Any modification done with in the function is local to it and will not be effected outside the function.
  • 17. EXAMPLE PROGRAM – CALL BY REFERENCE #include<stdio.h> void main() { int a=10; printf(“%d”,a); a=10 fun(a); printf(“%d”,a); a=10 } void fun(int x) { printf(“%d”,x) x=10 x++; printf(“%d”,x); x=11 }
  • 18. CALL BY REFERENCE Calling a function by passing pointers as parameters (address of variables is passed instead of variables). int a=1; void fun(int *x) fun(&a); { defn; } Any modification done to variable a will effect outside the function also.
  • 19. EXAMPLE PROGRAM – CALL BY REFERENCE #include<stdio.h> void main() { int a=10; printf(“%d”,a); a=10 fun(a); printf(“%d”,a); a=11 } void fun(int x) { printf(“%d”,x) x=10 printf(“%d”,x); x=11 } a and x are referring to same location. So value will be over written.