SlideShare a Scribd company logo
1 of 12
1. Variable, Data types + Input/Output
Instruction & Operators
Condtional Statements
Loop Control Statement
Function & Recursion
Pointer
Array
Strings
Structures
File I/o
Dynamic Memory Allocation
CHAPTER -1
 Variables
 Keywords
 Constants
 Comments
 Structure
 Compilation
VARIABLE
VARIABLE IS THE NAME OF A MEMORY
LOCATION WHICH STORES SOME DATA.
 Variables Rules
 Variable are case sensitive
 1st character is alphabet or ‘_’
 No comma/blank space
 No other symbol other than’_’
VARIABLE DATA TYPES
 Data Type Size In Bytes
 Char or signed char 1
 Unsigned char 1
 Int or signed int 2
 Unsigned int 2
 Short int or Unsigned short int 2
 Signed short int 2
 Long int or signed long int 4
 Unsigned long int 4
 Float 4
 Double 8
 Long Double 10
CONSTANTS
 Value that don’t change (fixed)
Types
 Integer Constants 1,2,3,0,-1,-2
 Real Constants 1,0,2,0,3.14,2.4
 Character Constants ‘a’,’b’,’A’,’#’,’&’
KEYWORDS
 Reserved words that have special meaning to the
compiler
 32 Keyword in C
auto double int Struct
break else long Switch
case enum register Typedef
char extern return Union
continue for signed Void
do if static While
default goto sizeof Volatile
const float short unsigned
PROGRAM STRUCTURE#
#include <stdio.h>
Int main
{
Printf(“hello world”)
Return 0;
}
COMMENTS
 Lines that are not part of program
Single Line Multiple Line
// /*
*/
OUTPUT
 Printf(“hello world”);
 New Line
Printf(“hello world n”);
OUTPUT
CASES
1. Integers
Printf(“age is %d”,age);
2. Real Number
Printf(“value of pi is %f”,pi);
3. Characters
Printf(“star looks like this %c”, star);
Programm
#include<stdio.h>
Int main ()
{
Int age = 22;
Printf(“age is %d”, age);
Return 0;
}
INPUT
I/o Program
Scanf(“%d”,&age);
# include<stdio.h>
Int main()
{
Int a,b;
Printf(“enter a”);
scanf(“%d”,&a);
Printf(“enter b”);
Scanf(“%d”,&b);
//Int sum = a+b;
//Printf(“sum is : %d”, sum);
Printf(“sum is : %d”, a+b);
Return 0;
}
COMPILATION
 A computer program that transaction C code into machine code
Practice Qs 1
1- Write a program to calculate area of a square (side is given)
#include<stdio.h>
// area of square
Int main()
Int side ;
Printf(“enter side”);
Scanf(“%d”, &side);
Printf(“area is : %d”, side * side);
Return 0;
2- Write a program to calculate are of a circle. (side is given)
#include<stdio.h>
// area of square
Int main()
Float radius ;
Printf(“enter radius”);
Scanf(“%f”, &radius);
Printf(“area is : %f”, 3.14 * redius * redius);
Return 0;
C LANGUAGE.pptx

More Related Content

Similar to C LANGUAGE.pptx

Similar to C LANGUAGE.pptx (20)

Chap 1 and 2
Chap 1 and 2Chap 1 and 2
Chap 1 and 2
 
Problem Solving Techniques
Problem Solving TechniquesProblem Solving Techniques
Problem Solving Techniques
 
C introduction by thooyavan
C introduction by  thooyavanC introduction by  thooyavan
C introduction by thooyavan
 
presentation_data_types_and_operators_1513499834_241350.pptx
presentation_data_types_and_operators_1513499834_241350.pptxpresentation_data_types_and_operators_1513499834_241350.pptx
presentation_data_types_and_operators_1513499834_241350.pptx
 
Python Programming by Dr. C. Sreedhar.pdf
Python Programming by Dr. C. Sreedhar.pdfPython Programming by Dr. C. Sreedhar.pdf
Python Programming by Dr. C. Sreedhar.pdf
 
Programming-in-C
Programming-in-CProgramming-in-C
Programming-in-C
 
Unit1 C
Unit1 CUnit1 C
Unit1 C
 
Unit1 C
Unit1 CUnit1 C
Unit1 C
 
C_Programming_Language_tutorial__Autosaved_.pptx
C_Programming_Language_tutorial__Autosaved_.pptxC_Programming_Language_tutorial__Autosaved_.pptx
C_Programming_Language_tutorial__Autosaved_.pptx
 
Chapter3
Chapter3Chapter3
Chapter3
 
dinoC_ppt.pptx
dinoC_ppt.pptxdinoC_ppt.pptx
dinoC_ppt.pptx
 
c_pro_introduction.pptx
c_pro_introduction.pptxc_pro_introduction.pptx
c_pro_introduction.pptx
 
Getting started with c++
Getting started with c++Getting started with c++
Getting started with c++
 
Getting started with c++
Getting started with c++Getting started with c++
Getting started with c++
 
Programming in C Basics
Programming in C BasicsProgramming in C Basics
Programming in C Basics
 
Cbasic
CbasicCbasic
Cbasic
 
Programming construction tools
Programming construction toolsProgramming construction tools
Programming construction tools
 
Cpu
CpuCpu
Cpu
 
Programming in C
Programming in CProgramming in C
Programming in C
 
Introduction to C
Introduction to CIntroduction to C
Introduction to C
 

Recently uploaded

HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxmarlenawright1
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxDr. Ravikiran H M Gowda
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Pooja Bhuva
 
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
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17Celine George
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxCeline George
 
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)Jisc
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structuredhanjurrannsibayan2
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 

Recently uploaded (20)

HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
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...
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
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
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 

C LANGUAGE.pptx

  • 1. 1. Variable, Data types + Input/Output Instruction & Operators Condtional Statements Loop Control Statement Function & Recursion Pointer Array Strings Structures File I/o Dynamic Memory Allocation
  • 2. CHAPTER -1  Variables  Keywords  Constants  Comments  Structure  Compilation
  • 3. VARIABLE VARIABLE IS THE NAME OF A MEMORY LOCATION WHICH STORES SOME DATA.  Variables Rules  Variable are case sensitive  1st character is alphabet or ‘_’  No comma/blank space  No other symbol other than’_’
  • 4. VARIABLE DATA TYPES  Data Type Size In Bytes  Char or signed char 1  Unsigned char 1  Int or signed int 2  Unsigned int 2  Short int or Unsigned short int 2  Signed short int 2  Long int or signed long int 4  Unsigned long int 4  Float 4  Double 8  Long Double 10
  • 5. CONSTANTS  Value that don’t change (fixed) Types  Integer Constants 1,2,3,0,-1,-2  Real Constants 1,0,2,0,3.14,2.4  Character Constants ‘a’,’b’,’A’,’#’,’&’
  • 6. KEYWORDS  Reserved words that have special meaning to the compiler  32 Keyword in C auto double int Struct break else long Switch case enum register Typedef char extern return Union continue for signed Void do if static While default goto sizeof Volatile const float short unsigned
  • 7. PROGRAM STRUCTURE# #include <stdio.h> Int main { Printf(“hello world”) Return 0; }
  • 8. COMMENTS  Lines that are not part of program Single Line Multiple Line // /* */
  • 9. OUTPUT  Printf(“hello world”);  New Line Printf(“hello world n”); OUTPUT CASES 1. Integers Printf(“age is %d”,age); 2. Real Number Printf(“value of pi is %f”,pi); 3. Characters Printf(“star looks like this %c”, star); Programm #include<stdio.h> Int main () { Int age = 22; Printf(“age is %d”, age); Return 0; }
  • 10. INPUT I/o Program Scanf(“%d”,&age); # include<stdio.h> Int main() { Int a,b; Printf(“enter a”); scanf(“%d”,&a); Printf(“enter b”); Scanf(“%d”,&b); //Int sum = a+b; //Printf(“sum is : %d”, sum); Printf(“sum is : %d”, a+b); Return 0; }
  • 11. COMPILATION  A computer program that transaction C code into machine code Practice Qs 1 1- Write a program to calculate area of a square (side is given) #include<stdio.h> // area of square Int main() Int side ; Printf(“enter side”); Scanf(“%d”, &side); Printf(“area is : %d”, side * side); Return 0; 2- Write a program to calculate are of a circle. (side is given) #include<stdio.h> // area of square Int main() Float radius ; Printf(“enter radius”); Scanf(“%f”, &radius); Printf(“area is : %f”, 3.14 * redius * redius); Return 0;