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

SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxAmanpreet Kaur
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
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
 
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.pptxAreebaZafar22
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
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...Poonam Aher Patil
 
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
 
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
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Association for Project Management
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
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Ữ Â...Nguyen Thanh Tu Collection
 
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).pptxEsquimalt MFRC
 
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 POSCeline George
 
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)Jisc
 
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.pptxMaritesTamaniVerdade
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 

Recently uploaded (20)

SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
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
 
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
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
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...
 
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)
 
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_...
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
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Ữ Â...
 
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
 
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
 
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)
 
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
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 

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;