SlideShare uma empresa Scribd logo
1 de 76
Tushar B. Kute, Department of Information Technology, Sandip Institute of Technology and Research Centre, Nashik An Imperative Study of ‘C’
Outline ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Why ‘C’ only?
Problem Solving ,[object Object],[object Object],[object Object],[object Object],[object Object]
Two views of program user interface software layers hidden by user interface user’s view programmer’s view
Alphabets, Digits, Special Symbols. Constants, Variables, And Keywords Instructions Program. Forming a C program
Compiling a C program
Basic Programming Concepts ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Sample C Program ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Control Statements ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
if  Statements ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Condition ? statement1 statement2 statement3 true false
The  if...else  Statement ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
if...else  Example ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Multiple Alternative if Statements ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],if (score >= 90) grade = ‘A’; else if (score >= 80) grade = ‘B’; else if (score >= 70)  grade = ‘C’; else if (score >= 60) grade = ‘D’; else  grade = ‘F’;
switch   Statements ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
switch  Statement Flow Chart
Repetitions ,[object Object],[object Object],[object Object],[object Object]
while  Loop while (continuation-condition)  { // loop-body; }
while  Loop Flow Chart, cont. int i = 0; while (i < 100) { printf(&quot;Welcome to C!&quot;); i++; }
do-while  Loop do { // Loop body; } while (continue-condition);
for  Loop  for (initialization; condition; increment/decrement) { //loop body; }
Caution ,[object Object],[object Object],[object Object],[object Object],[object Object],Wrong
Caution, cont. ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Wrong Correct
Which Loop to Use?
The  break  Keyword
Example:  break  statement ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
The  continue  Keyword
Example:  continue  statement ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Arrays Array is a data structure that represents a collection of the same types of data.  An Array of 10 Elements of type  int
Declaring Array Variables ,[object Object],[object Object],[object Object],[object Object],[object Object]
Creating Arrays ,[object Object],[object Object],[object Object],[object Object],[object Object]
Declaring and Creating in One Step ,[object Object],[object Object],[object Object],[object Object]
The Length of Arrays ,[object Object],[object Object],[object Object],[object Object],[object Object]
Declaring, creating, initializing Using the Shorthand Notation ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
CAUTION ,[object Object],[object Object],[object Object]
Copying Arrays ,[object Object],[object Object],[object Object],[object Object]
Multidimensional Arrays ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Multidimensional Array Illustration
Function
What is a Function ? ,[object Object],[object Object],[object Object]
Types of Functions ,[object Object],[object Object],[object Object],[object Object],[object Object]
User defined functions ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Declaration of many functions. ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Some conclusions ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Summarization ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Summarization Contd………. ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Summarization Contd………. ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Summarization Contd………. ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Why use functions ? ,[object Object],[object Object]
Passing values to functions. ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],i, j, k are actual arguments x, y, z are formal arguments.
Returning a value ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
return ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Function declaration and Prototype. ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Function prototype.
Structures ,[object Object],[object Object]
‘ C’ implementation of Structure. ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Accessing structure elements ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
How structure elements are stored ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],z.name  z.pages  z.price   ‘ s’ 125 90.0
Valid declaration ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Remember: ,[object Object],[object Object],[object Object]
Example: Creating a student database of 3 students. ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Array of structures ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Memory map for arrays a[i].roll  a[i].name  a[i].marks i 2 1 9 3 0 7 6 5 4 8 a[5].roll a[9].name
Pointers
Pointer Variables ,[object Object],[object Object],[object Object],int * p; /*  variable  p  can hold the address of a   memory location that contains an  int  */ char * chptr; /*  chptr  can hold the address of a   memory location that contains a  char   */
Dereferencing Operator ,[object Object],[object Object],[object Object],int *p; p ? *p = 7; Address in  p  could be any memory location Attempt to put a value into an unknown memory location will result in a  run-time error , or worse, a  logic error
[object Object],[object Object],[object Object],[object Object],Pointer
The Address Operator ,[object Object],[object Object],int x, *p; p ? x ? p = &x; *p = 4; p x ? p x 4 Value of  x  has been changed Value of  p  has been changed
The Null Pointer ,[object Object],[object Object]
Pointer Example int *p, x, y, *q = NULL; p = &x; *p = 4; p x  (or *p) y 4 ? p = &y; p x  y 4 ? *p   is now another name for   y q q . .
*p = 8; p x  y 4 8 q = p; p x  y 4 8 q *p or *q q *p .
p = &x; p x  y 4 8 *q *p = *q; p x  y 8 8 q *p q *p *q 8
Arrays of Pointers ,[object Object],[object Object],int j = 6; k = 4; int * arrayOfPtr[4]; j k 6 4 arrayOfPtr ? ? ? ? 0 1 2 3 Pointers in array are not initialized yet
arrayOfPtr[0] = &k;  arrayOfPtr[2]=&j;  j k 6 4 arrayOfPtr ? 0 1 2 3 ?
Array Names as Pointers ,[object Object],[object Object],[object Object],[object Object],[object Object]
Functions Calls ,[object Object],[object Object]
References ,[object Object],[object Object],[object Object],[object Object]

Mais conteúdo relacionado

Mais procurados

C Prog - Functions
C Prog - FunctionsC Prog - Functions
C Prog - Functions
vinay arora
 
FP 201 Unit 2 - Part 3
FP 201 Unit 2 - Part 3FP 201 Unit 2 - Part 3
FP 201 Unit 2 - Part 3
rohassanie
 
Dti2143 chapter 5
Dti2143 chapter 5Dti2143 chapter 5
Dti2143 chapter 5
alish sha
 

Mais procurados (20)

Maharishi University of Management (MSc Computer Science test questions)
Maharishi University of Management (MSc Computer Science test questions)Maharishi University of Management (MSc Computer Science test questions)
Maharishi University of Management (MSc Computer Science test questions)
 
C Prog - Functions
C Prog - FunctionsC Prog - Functions
C Prog - Functions
 
lets play with "c"..!!! :):)
lets play with "c"..!!! :):)lets play with "c"..!!! :):)
lets play with "c"..!!! :):)
 
Function & Recursion in C
Function & Recursion in CFunction & Recursion in C
Function & Recursion in C
 
46630497 fun-pointer-1
46630497 fun-pointer-146630497 fun-pointer-1
46630497 fun-pointer-1
 
8 arrays and pointers
8  arrays and pointers8  arrays and pointers
8 arrays and pointers
 
C programming function
C  programming functionC  programming function
C programming function
 
Functions
FunctionsFunctions
Functions
 
4 operators, expressions &amp; statements
4  operators, expressions &amp; statements4  operators, expressions &amp; statements
4 operators, expressions &amp; statements
 
C tech questions
C tech questionsC tech questions
C tech questions
 
C++11
C++11C++11
C++11
 
FP 201 Unit 2 - Part 3
FP 201 Unit 2 - Part 3FP 201 Unit 2 - Part 3
FP 201 Unit 2 - Part 3
 
Unit 5 Foc
Unit 5 FocUnit 5 Foc
Unit 5 Foc
 
Fp201 unit4
Fp201 unit4Fp201 unit4
Fp201 unit4
 
Advanced C - Part 2
Advanced C - Part 2Advanced C - Part 2
Advanced C - Part 2
 
Function in c program
Function in c programFunction in c program
Function in c program
 
Dti2143 chapter 5
Dti2143 chapter 5Dti2143 chapter 5
Dti2143 chapter 5
 
1 introducing c language
1  introducing c language1  introducing c language
1 introducing c language
 
C Programming Language Part 6
C Programming Language Part 6C Programming Language Part 6
C Programming Language Part 6
 
9 character string &amp; string library
9  character string &amp; string library9  character string &amp; string library
9 character string &amp; string library
 

Destaque (6)

Module 01 Introduction to Linux
Module 01 Introduction to LinuxModule 01 Introduction to Linux
Module 01 Introduction to Linux
 
Module 3 Using Linux Softwares.
Module 3 Using Linux Softwares.Module 3 Using Linux Softwares.
Module 3 Using Linux Softwares.
 
See through C
See through CSee through C
See through C
 
Internal components of PC
Internal components of PCInternal components of PC
Internal components of PC
 
C ppt
C pptC ppt
C ppt
 
Basics of C programming
Basics of C programmingBasics of C programming
Basics of C programming
 

Semelhante a An imperative study of c

1. DSA - Introduction.pptx
1. DSA - Introduction.pptx1. DSA - Introduction.pptx
1. DSA - Introduction.pptx
hara69
 
function in in thi pdf you will learn what is fu...
function in  in thi pdf you will learn   what                           is fu...function in  in thi pdf you will learn   what                           is fu...
function in in thi pdf you will learn what is fu...
kushwahashivam413
 

Semelhante a An imperative study of c (20)

Function in c program
Function in c programFunction in c program
Function in c program
 
C programming
C programmingC programming
C programming
 
C intro
C introC intro
C intro
 
Functions
FunctionsFunctions
Functions
 
Embedded C - Day 2
Embedded C - Day 2Embedded C - Day 2
Embedded C - Day 2
 
1. DSA - Introduction.pptx
1. DSA - Introduction.pptx1. DSA - Introduction.pptx
1. DSA - Introduction.pptx
 
Code optimization
Code optimization Code optimization
Code optimization
 
Code optimization
Code optimization Code optimization
Code optimization
 
Assignment c programming
Assignment c programmingAssignment c programming
Assignment c programming
 
Introduction to Basic C programming 01
Introduction to Basic C programming 01Introduction to Basic C programming 01
Introduction to Basic C programming 01
 
function in in thi pdf you will learn what is fu...
function in  in thi pdf you will learn   what                           is fu...function in  in thi pdf you will learn   what                           is fu...
function in in thi pdf you will learn what is fu...
 
CHAPTER 6
CHAPTER 6CHAPTER 6
CHAPTER 6
 
Array Cont
Array ContArray Cont
Array Cont
 
C programming
C programmingC programming
C programming
 
Function in c
Function in cFunction in c
Function in c
 
C function
C functionC function
C function
 
Unit2 C
Unit2 C Unit2 C
Unit2 C
 
Unit2 C
Unit2 CUnit2 C
Unit2 C
 
chapter-6 slide.pptx
chapter-6 slide.pptxchapter-6 slide.pptx
chapter-6 slide.pptx
 
Fundamentals of computer programming by Dr. A. Charan Kumari
Fundamentals of computer programming by Dr. A. Charan KumariFundamentals of computer programming by Dr. A. Charan Kumari
Fundamentals of computer programming by Dr. A. Charan Kumari
 

Mais de Tushar B Kute

Mais de Tushar B Kute (20)

Apache Pig: A big data processor
Apache Pig: A big data processorApache Pig: A big data processor
Apache Pig: A big data processor
 
01 Introduction to Android
01 Introduction to Android01 Introduction to Android
01 Introduction to Android
 
Ubuntu OS and it's Flavours
Ubuntu OS and it's FlavoursUbuntu OS and it's Flavours
Ubuntu OS and it's Flavours
 
Install Drupal in Ubuntu by Tushar B. Kute
Install Drupal in Ubuntu by Tushar B. KuteInstall Drupal in Ubuntu by Tushar B. Kute
Install Drupal in Ubuntu by Tushar B. Kute
 
Install Wordpress in Ubuntu Linux by Tushar B. Kute
Install Wordpress in Ubuntu Linux by Tushar B. KuteInstall Wordpress in Ubuntu Linux by Tushar B. Kute
Install Wordpress in Ubuntu Linux by Tushar B. Kute
 
Share File easily between computers using sftp
Share File easily between computers using sftpShare File easily between computers using sftp
Share File easily between computers using sftp
 
Signal Handling in Linux
Signal Handling in LinuxSignal Handling in Linux
Signal Handling in Linux
 
Implementation of FIFO in Linux
Implementation of FIFO in LinuxImplementation of FIFO in Linux
Implementation of FIFO in Linux
 
Implementation of Pipe in Linux
Implementation of Pipe in LinuxImplementation of Pipe in Linux
Implementation of Pipe in Linux
 
Basic Multithreading using Posix Threads
Basic Multithreading using Posix ThreadsBasic Multithreading using Posix Threads
Basic Multithreading using Posix Threads
 
Part 04 Creating a System Call in Linux
Part 04 Creating a System Call in LinuxPart 04 Creating a System Call in Linux
Part 04 Creating a System Call in Linux
 
Part 03 File System Implementation in Linux
Part 03 File System Implementation in LinuxPart 03 File System Implementation in Linux
Part 03 File System Implementation in Linux
 
Part 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module ProgrammingPart 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module Programming
 
Part 01 Linux Kernel Compilation (Ubuntu)
Part 01 Linux Kernel Compilation (Ubuntu)Part 01 Linux Kernel Compilation (Ubuntu)
Part 01 Linux Kernel Compilation (Ubuntu)
 
Open source applications softwares
Open source applications softwaresOpen source applications softwares
Open source applications softwares
 
Introduction to Ubuntu Edge Operating System (Ubuntu Touch)
Introduction to Ubuntu Edge Operating System (Ubuntu Touch)Introduction to Ubuntu Edge Operating System (Ubuntu Touch)
Introduction to Ubuntu Edge Operating System (Ubuntu Touch)
 
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B Kute
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B KuteUnit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B Kute
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B Kute
 
Technical blog by Engineering Students of Sandip Foundation, itsitrc
Technical blog by Engineering Students of Sandip Foundation, itsitrcTechnical blog by Engineering Students of Sandip Foundation, itsitrc
Technical blog by Engineering Students of Sandip Foundation, itsitrc
 
Chapter 01 Introduction to Java by Tushar B Kute
Chapter 01 Introduction to Java by Tushar B KuteChapter 01 Introduction to Java by Tushar B Kute
Chapter 01 Introduction to Java by Tushar B Kute
 
Chapter 02: Classes Objects and Methods Java by Tushar B Kute
Chapter 02: Classes Objects and Methods Java by Tushar B KuteChapter 02: Classes Objects and Methods Java by Tushar B Kute
Chapter 02: Classes Objects and Methods Java by Tushar B Kute
 

Último

Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 

Último (20)

How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 

An imperative study of c

  • 1. Tushar B. Kute, Department of Information Technology, Sandip Institute of Technology and Research Centre, Nashik An Imperative Study of ‘C’
  • 2.
  • 4.
  • 5. Two views of program user interface software layers hidden by user interface user’s view programmer’s view
  • 6. Alphabets, Digits, Special Symbols. Constants, Variables, And Keywords Instructions Program. Forming a C program
  • 7. Compiling a C program
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16. switch Statement Flow Chart
  • 17.
  • 18. while Loop while (continuation-condition) { // loop-body; }
  • 19. while Loop Flow Chart, cont. int i = 0; while (i < 100) { printf(&quot;Welcome to C!&quot;); i++; }
  • 20. do-while Loop do { // Loop body; } while (continue-condition);
  • 21. for Loop for (initialization; condition; increment/decrement) { //loop body; }
  • 22.
  • 23.
  • 25. The break Keyword
  • 26.
  • 27. The continue Keyword
  • 28.
  • 29. Arrays Array is a data structure that represents a collection of the same types of data. An Array of 10 Elements of type int
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
  • 52.
  • 53.
  • 54.
  • 55.
  • 56.
  • 57.
  • 58.
  • 59.
  • 60.
  • 61.
  • 62. Memory map for arrays a[i].roll a[i].name a[i].marks i 2 1 9 3 0 7 6 5 4 8 a[5].roll a[9].name
  • 64.
  • 65.
  • 66.
  • 67.
  • 68.
  • 69. Pointer Example int *p, x, y, *q = NULL; p = &x; *p = 4; p x (or *p) y 4 ? p = &y; p x y 4 ? *p is now another name for y q q . .
  • 70. *p = 8; p x y 4 8 q = p; p x y 4 8 q *p or *q q *p .
  • 71. p = &x; p x y 4 8 *q *p = *q; p x y 8 8 q *p q *p *q 8
  • 72.
  • 73. arrayOfPtr[0] = &k; arrayOfPtr[2]=&j; j k 6 4 arrayOfPtr ? 0 1 2 3 ?
  • 74.
  • 75.
  • 76.