SlideShare a Scribd company logo
1 of 10
BY REHAN IJAZ
04- Getting Started with C
BY REHAN IJAZ
C's Character Set
C does not use, nor requires the use of, every character found on a modern computer
keyboard. The use of most of this set of characters will be discussed throughout the course. The
only characters required by the C Programming Language are as follows:
character:- It denotes any alphabet, digit or special symbol used to represent information.
Use:- These characters can be combined to form variables. C uses variables, operators,
keywords and expressions as building blocks to form a basic C program.
Character set:- The character set is the fundamental raw material of any language and they are
used to represent information. Like natural languages, computer language will also have well
defined character set, which is useful to build the programs.
The characters in C are grouped into the following two categories:
1. Source characterset
a. Alphabets
b. Digits
c. Special Characters
d. White Spaces
2. Execution characterset
a. Escape Sequence
1. Source character set
ALPHABETS
Uppercase letters A-Z
Lowercase letters a-z
DIGITS 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
SPECIAL CHARACTERS
WHITESPACE CHARACTERS
b blank space t horizontal tab v vertical tab r carriage return f form feed n new line
BY REHAN IJAZ
 Back slash ’ Single quote " Double quote ? Question mark 0 Null a Alarm (bell)
2. Execution Character Set
Certain ASCII characters are unprintable, which means they are not displayed on the screen or
printer. Those characters perform other functions aside from displaying text. Examples are
backspacing or moving to a newline .
They are used in output statements. Escape sequence usually consists of a backslash and a
letter or a combination of digits. An escape sequence is considered as a single character but a
valid character constant.
These are employed at the time of execution of the program. Execution characters set are
always represented by a backslash () followed by a character. Note that each one of character
constants represents one character, although they consist of two characters. These characters
combinations are called as escape sequence.
Escape Sequence
Invalid Sequence
#include <stdio.h>
int main()
{
printf("Hello,
world!");
}
Correct Sequence
#include <stdio.h>
int main()
{
printf("Hello,nworld!");
}
BY REHAN IJAZ
More Escape Sequences
 Null 0 Null
 Alarm (bell) a Beep Sound
 Back space b Moves previous position
 Horizontal tab t Moves next horizontal tab
 New line n Moves next Line
 Vertical tab v Moves next vertical tab
 Form feed f Moves initial position of next page
 Carriage return r Moves beginning of the line
 Double quote " Present Double quotes
 Single quote ' Present Apostrophe
 Question mark ? Present Question Mark
 Back slash  Present back slash
BY REHAN IJAZ
C’s Variable
 C variable is a named location in a memory where a program can manipulate the data.
This location is used to hold the value of the variable.
 The value of the C variable may get change in the program.
 C variable might be belonging to any of the data type like int, float, char etc.
Rules for naming C variable:
1. Variable name must begin with letter or underscore.
2. Variable names are case sensitive
3. They can be constructed with digits, letters.
4. No special symbols are allowed other than underscore.
5. sum, height, _value are some examples for variable name
Declaring & initializing C variable:
 Variables should be declared in the C program before to use.
 Memory space is not allocated for a variable while declaration. It happens only on
variable definition.
 Variable initialization means assigning a value to the variable.
S.No Type Syntax Example
1 Variable
declaration
data_type variable_name; int x, y, z; char flat, ch;
2 Variable
initialization
data_type variable_name =
value;
int x = 50, y = 30; char flag
= ‘x’, ch=’l’;
Variable types
There are three types of variables in C program They are,
1. Local variable
2. Global variable
3. Environment variable
BY REHAN IJAZ
1. Example program for local variable in C:
 The scope of local variables will be within the function only.
 These variables are declared within the function and can’t be accessed outside the
function.
 In the below example, m and n variables are having scope within the main function only.
These are not visible to test function.
 Like wise, a and b variables are having scope within the test function only. These are not
visible to main function.
#include<stdio.h>
void test();
int main()
{
int m = 22, n = 44;
printf(“nvalues : m = %d and n = %d”, m, n);
test();
}
void test()
{
int a = 50, b = 80;
printf(“nvalues : a = %d and b = %d”, a, b);
}
Output:
values : m = 22 and n = 44
values : a = 50 and b = 80
BY REHAN IJAZ
2. Example program for global variable in C:
 The scope of global variables will be throughout the program. These variables can be
accessed from anywhere in the program.
 This variable is defined outside the main function. So that, this variable is visible to main
function and all other sub functions.
#include<stdio.h>
void test();int m = 22, n = 44;
int a = 50, b = 80;
int main()
{
printf(“All variables are accessed from main function”);
printf(“nvalues: m=%d:n=%d:a=%d:b=%d”, m,n,a,b);
test();
}
void test()
{
printf(“nnAll variables are accessed from”
” test function”);
printf(“nvalues: m=%d:n=%d:a=%d:b=%d”, m,n,a,b);
}
Output:
All variables are accessed from main function
values : m = 22 : n = 44 : a = 50 : b = 80
All variables are accessed from test function
values : m = 22 : n = 44 : a = 50 : b = 80
BY REHAN IJAZ
C’s Identifiers
Identifiers in C language:
 Each program elements in a C program are given a name called identifiers.
 Names given to identify Variables, functions and arrays are examples for identifiers. eg.
x is a name given to integer variable in above program.
Rules for constructing identifier name in C:
1. First character should be an alphabet or underscore.
2. Succeeding characters might be digits or letter.
3. Punctuation and special characters aren’t allowed except underscore.
4. Identifiers should not be keywords.
BY REHAN IJAZ
C’s Key words
 Keywords are pre-defined words in a C compiler.
 Each keyword is meant to perform a specific function in a C program.
 Since keywords are referred names for compiler, they can’t be used as variable name.
C language supports 32 keywords which are given below.
auto double int struct const float short unsigned
break else long switch continue for signed void
case enum register typedef default goto sizeof volatile
char extern return union do if static while
BY REHAN IJAZ

More Related Content

What's hot

Data Input and Output
Data Input and OutputData Input and Output
Data Input and OutputSabik T S
 
Concepts of C [Module 2]
Concepts of C [Module 2]Concepts of C [Module 2]
Concepts of C [Module 2]Abhishek Sinha
 
Operators and expressions in c language
Operators and expressions in c languageOperators and expressions in c language
Operators and expressions in c languagetanmaymodi4
 
Unit ii chapter 2 Decision making and Branching in C
Unit ii chapter 2 Decision making and Branching in CUnit ii chapter 2 Decision making and Branching in C
Unit ii chapter 2 Decision making and Branching in CSowmya Jyothi
 
C programming Workshop
C programming WorkshopC programming Workshop
C programming Workshopneosphere
 
Variables in C Programming
Variables in C ProgrammingVariables in C Programming
Variables in C Programmingprogramming9
 
Introduction to C programming
Introduction to C programmingIntroduction to C programming
Introduction to C programmingSabik T S
 
Input output statement in C
Input output statement in CInput output statement in C
Input output statement in CMuthuganesh S
 
Learn C# Programming - Operators
Learn C# Programming - OperatorsLearn C# Programming - Operators
Learn C# Programming - OperatorsEng Teong Cheah
 
C Language (All Concept)
C Language (All Concept)C Language (All Concept)
C Language (All Concept)sachindane
 
datatypes and variables in c language
 datatypes and variables in c language datatypes and variables in c language
datatypes and variables in c languageRai University
 
pointer, structure ,union and intro to file handling
pointer, structure ,union and intro to file handlingpointer, structure ,union and intro to file handling
pointer, structure ,union and intro to file handlingRai University
 
Mesics lecture 5 input – output in ‘c’
Mesics lecture 5   input – output in ‘c’Mesics lecture 5   input – output in ‘c’
Mesics lecture 5 input – output in ‘c’eShikshak
 
C programming(Part 1)
C programming(Part 1)C programming(Part 1)
C programming(Part 1)SURBHI SAROHA
 

What's hot (20)

Data Input and Output
Data Input and OutputData Input and Output
Data Input and Output
 
C Token’s
C Token’sC Token’s
C Token’s
 
Unit ii ppt
Unit ii pptUnit ii ppt
Unit ii ppt
 
Concepts of C [Module 2]
Concepts of C [Module 2]Concepts of C [Module 2]
Concepts of C [Module 2]
 
Operators and expressions in c language
Operators and expressions in c languageOperators and expressions in c language
Operators and expressions in c language
 
C program compiler presentation
C program compiler presentationC program compiler presentation
C program compiler presentation
 
Unit ii chapter 2 Decision making and Branching in C
Unit ii chapter 2 Decision making and Branching in CUnit ii chapter 2 Decision making and Branching in C
Unit ii chapter 2 Decision making and Branching in C
 
C programming Workshop
C programming WorkshopC programming Workshop
C programming Workshop
 
Variables in C Programming
Variables in C ProgrammingVariables in C Programming
Variables in C Programming
 
Introduction to C programming
Introduction to C programmingIntroduction to C programming
Introduction to C programming
 
Input output statement in C
Input output statement in CInput output statement in C
Input output statement in C
 
CPU INPUT OUTPUT
CPU INPUT OUTPUT CPU INPUT OUTPUT
CPU INPUT OUTPUT
 
Learn C# Programming - Operators
Learn C# Programming - OperatorsLearn C# Programming - Operators
Learn C# Programming - Operators
 
Input And Output
 Input And Output Input And Output
Input And Output
 
C Language (All Concept)
C Language (All Concept)C Language (All Concept)
C Language (All Concept)
 
C Programming
C ProgrammingC Programming
C Programming
 
datatypes and variables in c language
 datatypes and variables in c language datatypes and variables in c language
datatypes and variables in c language
 
pointer, structure ,union and intro to file handling
pointer, structure ,union and intro to file handlingpointer, structure ,union and intro to file handling
pointer, structure ,union and intro to file handling
 
Mesics lecture 5 input – output in ‘c’
Mesics lecture 5   input – output in ‘c’Mesics lecture 5   input – output in ‘c’
Mesics lecture 5 input – output in ‘c’
 
C programming(Part 1)
C programming(Part 1)C programming(Part 1)
C programming(Part 1)
 

Viewers also liked

Campbell Investments Limited Introduces Two New Multi-Asset Funds
Campbell Investments Limited Introduces Two New Multi-Asset FundsCampbell Investments Limited Introduces Two New Multi-Asset Funds
Campbell Investments Limited Introduces Two New Multi-Asset Fundskjprsubmission04
 
CALIBRATION OF VEHICLE EMISSIONS-SPEED RELATIONSHIPS FOR THE GREATER CAIRO ROADS
CALIBRATION OF VEHICLE EMISSIONS-SPEED RELATIONSHIPS FOR THE GREATER CAIRO ROADSCALIBRATION OF VEHICLE EMISSIONS-SPEED RELATIONSHIPS FOR THE GREATER CAIRO ROADS
CALIBRATION OF VEHICLE EMISSIONS-SPEED RELATIONSHIPS FOR THE GREATER CAIRO ROADSIAEME Publication
 
PARAMETRIC INVESTIGATIONS ON THE FLOW CHARACTERISTICS OF A CLOSED LOOP PULSAT...
PARAMETRIC INVESTIGATIONS ON THE FLOW CHARACTERISTICS OF A CLOSED LOOP PULSAT...PARAMETRIC INVESTIGATIONS ON THE FLOW CHARACTERISTICS OF A CLOSED LOOP PULSAT...
PARAMETRIC INVESTIGATIONS ON THE FLOW CHARACTERISTICS OF A CLOSED LOOP PULSAT...IAEME Publication
 
Felicitaciones
FelicitacionesFelicitaciones
Felicitacionesanabelro
 
Comunicado n° 3 2
Comunicado n° 3 2Comunicado n° 3 2
Comunicado n° 3 2sukyedu
 
SeniorDesign_PosterTemplateV1.2-1
SeniorDesign_PosterTemplateV1.2-1SeniorDesign_PosterTemplateV1.2-1
SeniorDesign_PosterTemplateV1.2-1Phillip Power
 
Crónicas de la ínsula 31 10
Crónicas de la ínsula 31 10Crónicas de la ínsula 31 10
Crónicas de la ínsula 31 10megaradioexpress
 
CompTIA A+ ce certificate (1)
CompTIA A+ ce certificate (1)CompTIA A+ ce certificate (1)
CompTIA A+ ce certificate (1)Colin Woodard
 
Cmp2412 programming principles
Cmp2412 programming principlesCmp2412 programming principles
Cmp2412 programming principlesNIKANOR THOMAS
 
Pós-Graduação Gestão de Negócios Online
Pós-Graduação Gestão de Negócios OnlinePós-Graduação Gestão de Negócios Online
Pós-Graduação Gestão de Negócios Onlinefredericocarvalho.pt
 

Viewers also liked (20)

Campbell Investments Limited Introduces Two New Multi-Asset Funds
Campbell Investments Limited Introduces Two New Multi-Asset FundsCampbell Investments Limited Introduces Two New Multi-Asset Funds
Campbell Investments Limited Introduces Two New Multi-Asset Funds
 
Poca 140318195851-phpapp02
Poca 140318195851-phpapp02Poca 140318195851-phpapp02
Poca 140318195851-phpapp02
 
Fuzzy motor
Fuzzy motorFuzzy motor
Fuzzy motor
 
Presentation
PresentationPresentation
Presentation
 
CALIBRATION OF VEHICLE EMISSIONS-SPEED RELATIONSHIPS FOR THE GREATER CAIRO ROADS
CALIBRATION OF VEHICLE EMISSIONS-SPEED RELATIONSHIPS FOR THE GREATER CAIRO ROADSCALIBRATION OF VEHICLE EMISSIONS-SPEED RELATIONSHIPS FOR THE GREATER CAIRO ROADS
CALIBRATION OF VEHICLE EMISSIONS-SPEED RELATIONSHIPS FOR THE GREATER CAIRO ROADS
 
PARAMETRIC INVESTIGATIONS ON THE FLOW CHARACTERISTICS OF A CLOSED LOOP PULSAT...
PARAMETRIC INVESTIGATIONS ON THE FLOW CHARACTERISTICS OF A CLOSED LOOP PULSAT...PARAMETRIC INVESTIGATIONS ON THE FLOW CHARACTERISTICS OF A CLOSED LOOP PULSAT...
PARAMETRIC INVESTIGATIONS ON THE FLOW CHARACTERISTICS OF A CLOSED LOOP PULSAT...
 
Curriculum Vitae (2016)
Curriculum Vitae (2016)Curriculum Vitae (2016)
Curriculum Vitae (2016)
 
Felicitaciones
FelicitacionesFelicitaciones
Felicitaciones
 
Comunicado n° 3 2
Comunicado n° 3 2Comunicado n° 3 2
Comunicado n° 3 2
 
Naomi 5e
Naomi 5eNaomi 5e
Naomi 5e
 
SeniorDesign_PosterTemplateV1.2-1
SeniorDesign_PosterTemplateV1.2-1SeniorDesign_PosterTemplateV1.2-1
SeniorDesign_PosterTemplateV1.2-1
 
Shot list
Shot list Shot list
Shot list
 
Crónicas de la ínsula 31 10
Crónicas de la ínsula 31 10Crónicas de la ínsula 31 10
Crónicas de la ínsula 31 10
 
Project Update - Earth Towne
Project Update - Earth TowneProject Update - Earth Towne
Project Update - Earth Towne
 
CompTIA A+ ce certificate (1)
CompTIA A+ ce certificate (1)CompTIA A+ ce certificate (1)
CompTIA A+ ce certificate (1)
 
Cmp2412 programming principles
Cmp2412 programming principlesCmp2412 programming principles
Cmp2412 programming principles
 
ACSN Issue #9
ACSN Issue #9ACSN Issue #9
ACSN Issue #9
 
Presentation1
Presentation1Presentation1
Presentation1
 
Reumatismo tratamiento
Reumatismo tratamientoReumatismo tratamiento
Reumatismo tratamiento
 
Pós-Graduação Gestão de Negócios Online
Pós-Graduação Gestão de Negócios OnlinePós-Graduação Gestão de Negócios Online
Pós-Graduação Gestão de Negócios Online
 

Similar to Programming Fundamentals lecture 4

Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C ProgrammingMOHAMAD NOH AHMAD
 
Unit 4 Foc
Unit 4 FocUnit 4 Foc
Unit 4 FocJAYA
 
C programing Tutorial
C programing TutorialC programing Tutorial
C programing TutorialMahira Banu
 
C programming language for beginners
C programming language for beginners C programming language for beginners
C programming language for beginners ShreyaSingh291866
 
C_Programming_Language_tutorial__Autosaved_.pptx
C_Programming_Language_tutorial__Autosaved_.pptxC_Programming_Language_tutorial__Autosaved_.pptx
C_Programming_Language_tutorial__Autosaved_.pptxLikhil181
 
UNIT-1 notes(Data Types – Variables – Operations – Expressions and Statements...
UNIT-1 notes(Data Types – Variables – Operations – Expressions and Statements...UNIT-1 notes(Data Types – Variables – Operations – Expressions and Statements...
UNIT-1 notes(Data Types – Variables – Operations – Expressions and Statements...RSathyaPriyaCSEKIOT
 
Problem Solving Techniques
Problem Solving TechniquesProblem Solving Techniques
Problem Solving Techniquesvalarpink
 
Esoft Metro Campus - Certificate in c / c++ programming
Esoft Metro Campus - Certificate in c / c++ programmingEsoft Metro Campus - Certificate in c / c++ programming
Esoft Metro Campus - Certificate in c / c++ programmingRasan Samarasinghe
 
C presentation book
C presentation bookC presentation book
C presentation bookkrunal1210
 
Reduce course notes class xii
Reduce course notes class xiiReduce course notes class xii
Reduce course notes class xiiSyed Zaid Irshad
 
C basics 4 std11(GujBoard)
C basics 4 std11(GujBoard)C basics 4 std11(GujBoard)
C basics 4 std11(GujBoard)indrasir
 
unit 1 cpds.pptx
unit 1 cpds.pptxunit 1 cpds.pptx
unit 1 cpds.pptxmadhurij54
 
2. introduction of a c program
2. introduction of a c program2. introduction of a c program
2. introduction of a c programAlamgir Hossain
 
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.pptxKrishanPalSingh39
 
Chapter3
Chapter3Chapter3
Chapter3Kamran
 

Similar to Programming Fundamentals lecture 4 (20)

Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
 
Unit 4 Foc
Unit 4 FocUnit 4 Foc
Unit 4 Foc
 
C programing Tutorial
C programing TutorialC programing Tutorial
C programing Tutorial
 
Introduction%20C.pptx
Introduction%20C.pptxIntroduction%20C.pptx
Introduction%20C.pptx
 
C
CC
C
 
C programming language for beginners
C programming language for beginners C programming language for beginners
C programming language for beginners
 
Unit 2- Module 2.pptx
Unit 2- Module 2.pptxUnit 2- Module 2.pptx
Unit 2- Module 2.pptx
 
C_Programming_Language_tutorial__Autosaved_.pptx
C_Programming_Language_tutorial__Autosaved_.pptxC_Programming_Language_tutorial__Autosaved_.pptx
C_Programming_Language_tutorial__Autosaved_.pptx
 
UNIT-1 notes(Data Types – Variables – Operations – Expressions and Statements...
UNIT-1 notes(Data Types – Variables – Operations – Expressions and Statements...UNIT-1 notes(Data Types – Variables – Operations – Expressions and Statements...
UNIT-1 notes(Data Types – Variables – Operations – Expressions and Statements...
 
Problem Solving Techniques
Problem Solving TechniquesProblem Solving Techniques
Problem Solving Techniques
 
Esoft Metro Campus - Certificate in c / c++ programming
Esoft Metro Campus - Certificate in c / c++ programmingEsoft Metro Campus - Certificate in c / c++ programming
Esoft Metro Campus - Certificate in c / c++ programming
 
C presentation book
C presentation bookC presentation book
C presentation book
 
Reduce course notes class xii
Reduce course notes class xiiReduce course notes class xii
Reduce course notes class xii
 
C basics 4 std11(GujBoard)
C basics 4 std11(GujBoard)C basics 4 std11(GujBoard)
C basics 4 std11(GujBoard)
 
unit 1 cpds.pptx
unit 1 cpds.pptxunit 1 cpds.pptx
unit 1 cpds.pptx
 
2. introduction of a c program
2. introduction of a c program2. introduction of a c program
2. introduction of a c program
 
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
 
C programming
C programmingC programming
C programming
 
Chapter3
Chapter3Chapter3
Chapter3
 
C programming
C programmingC programming
C programming
 

More from REHAN IJAZ

How to make presentation effective assignment
How to make presentation effective assignmentHow to make presentation effective assignment
How to make presentation effective assignmentREHAN IJAZ
 
Project code for Project on Student information management system
Project code for Project on Student information management systemProject code for Project on Student information management system
Project code for Project on Student information management systemREHAN IJAZ
 
Programming Fundamentals lecture 8
Programming Fundamentals lecture 8Programming Fundamentals lecture 8
Programming Fundamentals lecture 8REHAN IJAZ
 
Introduction to artificial intelligence lecture 1
Introduction to artificial intelligence lecture 1Introduction to artificial intelligence lecture 1
Introduction to artificial intelligence lecture 1REHAN IJAZ
 
Programming Fundamentals lecture 7
Programming Fundamentals lecture 7Programming Fundamentals lecture 7
Programming Fundamentals lecture 7REHAN IJAZ
 
Programming Fundamentals lecture 6
Programming Fundamentals lecture 6Programming Fundamentals lecture 6
Programming Fundamentals lecture 6REHAN IJAZ
 
Programming Fundamentals lecture 5
Programming Fundamentals lecture 5Programming Fundamentals lecture 5
Programming Fundamentals lecture 5REHAN IJAZ
 
Programming Fundamentals lecture 3
Programming Fundamentals lecture 3Programming Fundamentals lecture 3
Programming Fundamentals lecture 3REHAN IJAZ
 
Programming Fundamentals lecture 2
Programming Fundamentals lecture 2Programming Fundamentals lecture 2
Programming Fundamentals lecture 2REHAN IJAZ
 
Programming Fundamentals lecture 1
Programming Fundamentals lecture 1Programming Fundamentals lecture 1
Programming Fundamentals lecture 1REHAN IJAZ
 
Career development interviews
Career development interviewsCareer development interviews
Career development interviewsREHAN IJAZ
 
importance of Communication in business
importance of Communication in businessimportance of Communication in business
importance of Communication in businessREHAN IJAZ
 
Porposal on Student information management system
Porposal on Student information management systemPorposal on Student information management system
Porposal on Student information management systemREHAN IJAZ
 
Project on Student information management system
Project on Student information management systemProject on Student information management system
Project on Student information management systemREHAN IJAZ
 

More from REHAN IJAZ (14)

How to make presentation effective assignment
How to make presentation effective assignmentHow to make presentation effective assignment
How to make presentation effective assignment
 
Project code for Project on Student information management system
Project code for Project on Student information management systemProject code for Project on Student information management system
Project code for Project on Student information management system
 
Programming Fundamentals lecture 8
Programming Fundamentals lecture 8Programming Fundamentals lecture 8
Programming Fundamentals lecture 8
 
Introduction to artificial intelligence lecture 1
Introduction to artificial intelligence lecture 1Introduction to artificial intelligence lecture 1
Introduction to artificial intelligence lecture 1
 
Programming Fundamentals lecture 7
Programming Fundamentals lecture 7Programming Fundamentals lecture 7
Programming Fundamentals lecture 7
 
Programming Fundamentals lecture 6
Programming Fundamentals lecture 6Programming Fundamentals lecture 6
Programming Fundamentals lecture 6
 
Programming Fundamentals lecture 5
Programming Fundamentals lecture 5Programming Fundamentals lecture 5
Programming Fundamentals lecture 5
 
Programming Fundamentals lecture 3
Programming Fundamentals lecture 3Programming Fundamentals lecture 3
Programming Fundamentals lecture 3
 
Programming Fundamentals lecture 2
Programming Fundamentals lecture 2Programming Fundamentals lecture 2
Programming Fundamentals lecture 2
 
Programming Fundamentals lecture 1
Programming Fundamentals lecture 1Programming Fundamentals lecture 1
Programming Fundamentals lecture 1
 
Career development interviews
Career development interviewsCareer development interviews
Career development interviews
 
importance of Communication in business
importance of Communication in businessimportance of Communication in business
importance of Communication in business
 
Porposal on Student information management system
Porposal on Student information management systemPorposal on Student information management system
Porposal on Student information management system
 
Project on Student information management system
Project on Student information management systemProject on Student information management system
Project on Student information management system
 

Recently uploaded

Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...RajaP95
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 

Recently uploaded (20)

Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 

Programming Fundamentals lecture 4

  • 1. BY REHAN IJAZ 04- Getting Started with C
  • 2. BY REHAN IJAZ C's Character Set C does not use, nor requires the use of, every character found on a modern computer keyboard. The use of most of this set of characters will be discussed throughout the course. The only characters required by the C Programming Language are as follows: character:- It denotes any alphabet, digit or special symbol used to represent information. Use:- These characters can be combined to form variables. C uses variables, operators, keywords and expressions as building blocks to form a basic C program. Character set:- The character set is the fundamental raw material of any language and they are used to represent information. Like natural languages, computer language will also have well defined character set, which is useful to build the programs. The characters in C are grouped into the following two categories: 1. Source characterset a. Alphabets b. Digits c. Special Characters d. White Spaces 2. Execution characterset a. Escape Sequence 1. Source character set ALPHABETS Uppercase letters A-Z Lowercase letters a-z DIGITS 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 SPECIAL CHARACTERS WHITESPACE CHARACTERS b blank space t horizontal tab v vertical tab r carriage return f form feed n new line
  • 3. BY REHAN IJAZ Back slash ’ Single quote " Double quote ? Question mark 0 Null a Alarm (bell) 2. Execution Character Set Certain ASCII characters are unprintable, which means they are not displayed on the screen or printer. Those characters perform other functions aside from displaying text. Examples are backspacing or moving to a newline . They are used in output statements. Escape sequence usually consists of a backslash and a letter or a combination of digits. An escape sequence is considered as a single character but a valid character constant. These are employed at the time of execution of the program. Execution characters set are always represented by a backslash () followed by a character. Note that each one of character constants represents one character, although they consist of two characters. These characters combinations are called as escape sequence. Escape Sequence Invalid Sequence #include <stdio.h> int main() { printf("Hello, world!"); } Correct Sequence #include <stdio.h> int main() { printf("Hello,nworld!"); }
  • 4. BY REHAN IJAZ More Escape Sequences  Null 0 Null  Alarm (bell) a Beep Sound  Back space b Moves previous position  Horizontal tab t Moves next horizontal tab  New line n Moves next Line  Vertical tab v Moves next vertical tab  Form feed f Moves initial position of next page  Carriage return r Moves beginning of the line  Double quote " Present Double quotes  Single quote ' Present Apostrophe  Question mark ? Present Question Mark  Back slash Present back slash
  • 5. BY REHAN IJAZ C’s Variable  C variable is a named location in a memory where a program can manipulate the data. This location is used to hold the value of the variable.  The value of the C variable may get change in the program.  C variable might be belonging to any of the data type like int, float, char etc. Rules for naming C variable: 1. Variable name must begin with letter or underscore. 2. Variable names are case sensitive 3. They can be constructed with digits, letters. 4. No special symbols are allowed other than underscore. 5. sum, height, _value are some examples for variable name Declaring & initializing C variable:  Variables should be declared in the C program before to use.  Memory space is not allocated for a variable while declaration. It happens only on variable definition.  Variable initialization means assigning a value to the variable. S.No Type Syntax Example 1 Variable declaration data_type variable_name; int x, y, z; char flat, ch; 2 Variable initialization data_type variable_name = value; int x = 50, y = 30; char flag = ‘x’, ch=’l’; Variable types There are three types of variables in C program They are, 1. Local variable 2. Global variable 3. Environment variable
  • 6. BY REHAN IJAZ 1. Example program for local variable in C:  The scope of local variables will be within the function only.  These variables are declared within the function and can’t be accessed outside the function.  In the below example, m and n variables are having scope within the main function only. These are not visible to test function.  Like wise, a and b variables are having scope within the test function only. These are not visible to main function. #include<stdio.h> void test(); int main() { int m = 22, n = 44; printf(“nvalues : m = %d and n = %d”, m, n); test(); } void test() { int a = 50, b = 80; printf(“nvalues : a = %d and b = %d”, a, b); } Output: values : m = 22 and n = 44 values : a = 50 and b = 80
  • 7. BY REHAN IJAZ 2. Example program for global variable in C:  The scope of global variables will be throughout the program. These variables can be accessed from anywhere in the program.  This variable is defined outside the main function. So that, this variable is visible to main function and all other sub functions. #include<stdio.h> void test();int m = 22, n = 44; int a = 50, b = 80; int main() { printf(“All variables are accessed from main function”); printf(“nvalues: m=%d:n=%d:a=%d:b=%d”, m,n,a,b); test(); } void test() { printf(“nnAll variables are accessed from” ” test function”); printf(“nvalues: m=%d:n=%d:a=%d:b=%d”, m,n,a,b); } Output: All variables are accessed from main function values : m = 22 : n = 44 : a = 50 : b = 80 All variables are accessed from test function values : m = 22 : n = 44 : a = 50 : b = 80
  • 8. BY REHAN IJAZ C’s Identifiers Identifiers in C language:  Each program elements in a C program are given a name called identifiers.  Names given to identify Variables, functions and arrays are examples for identifiers. eg. x is a name given to integer variable in above program. Rules for constructing identifier name in C: 1. First character should be an alphabet or underscore. 2. Succeeding characters might be digits or letter. 3. Punctuation and special characters aren’t allowed except underscore. 4. Identifiers should not be keywords.
  • 9. BY REHAN IJAZ C’s Key words  Keywords are pre-defined words in a C compiler.  Each keyword is meant to perform a specific function in a C program.  Since keywords are referred names for compiler, they can’t be used as variable name. C language supports 32 keywords which are given below. auto double int struct const float short unsigned break else long switch continue for signed void case enum register typedef default goto sizeof volatile char extern return union do if static while