SlideShare a Scribd company logo
ARVIN santos buendia
OBJECTIVES Discuss the different data types that can be used in Turbo-C Explain and evaluate the rules in naming variables Create the syntax of data types and variable names in Turbo-C Codes
VARIABLE DECLARATION OF TURBO-C SYNTAX <data type>  <variable name> char   g ; int   x ,  y ,  z ; float   f=5.67 ; int   x=10 ; char   name[10] ;
< DATA TYPES > int  a whole number consisting of an optional sign (+ or -) followed by a sequence of digit  can hold integer quantities that do not require a fractional component or decimal places occupies two bytes in the address ranges from –32768 to +32767
< DATA TYPES > Types of int   long int takes up more space and can store large number ranges from –2147483648 to +2147483647 occupies 4 bytes unsigned int cannot be negative from 0 to 65536
< DATA TYPES > float  consists of an optional sign (+ or -), followed by one or more digits , a decimal point, and one or more further digits it can include an optional exponent ranging from 3.4 E –38 to 3.4 E +38 
< DATA TYPES > double is a special float which can store more significant digits and have longer exponent ranges from  1.7E-308 to 1.7E+308 with 15 digits accuracy
< DATA TYPES > char can be used to contain a single letter, digit, punctuation mark or control symbol recognized by the computer written enclosed within single quotation marks, but literals strings are enclosed in double quotation marks
< DATA TYPES > char a character may be assigned an integer value between –128 and  +127 unsigned char data type may be assigned an integer value from 0 to 255 char c; char b = ‘*’; char a[30]; char a = “apple”;
< VARIABLE NAME > arvin#030709 buendia_arvin : ] superman superman arvin25 [email_address]
< VARIABLE NAME > It must start with a letter or an underscore, with subsequent characters being letters, numbers, or the underscore _arvin superman 05buendia buendia05 %arvin *superman
< VARIABLE NAME > A Turbo C Variable may consist of 63 characters, but only the first 32 are significant do_you_know_that_this_is_one_long_variable_name_but_still_valid do_you_know_that_this_is_one_long_variable_name_but_still_considered_as_invalid tamahome miyaka_mikaela rain_mikayla
< VARIABLE NAME > A variable is case sensitive, that is, uppercase variables are treated differently   Variable “ SUM ” is different from variable “ sum ” Variable “ NetPay ” is different from variable “ NETpay ”
< VARIABLE NAME > A variable cannot be the same as a Turbo C keyword. float elwin main ping dota printf
< VARIABLE NAME > A variable cannot be the same as a Turbo C keyword. float elwin main ping dota printf
< VARIABLE NAME > Variable names must be unique and descriptive   area sheverlou cute surname product churva
<  DECLARING VARIABLES  > #include<stdio.h> main( ) { int peso;   printf(“Variable Value :  %i ”,  peso ); } _ Variable Value :  _ 0 _ 0 0
<  DECLARING VARIABLES  > #include<stdio.h> main( ) { char let;   printf(“Variable Value :  %c ”,  let ); } _ Variable Value :  _ ả _ ả ả
<  DECLARING VARIABLES  > #include<stdio.h> main( ) { int x,y; printf(“Variable Values :  %i  %d ”,  x ,  y ); } _ Variable Value :  _ 0 _ 0 VARIABLE 1 VARIABLE 2 0 0 0 0 _
<  DECLARING VARIABLES  > #include<stdio.h> main( ) { float gross=5.84365; int age=3;  printf(“Variable Values :  %i  %.3f ”,  age ,  gross ); } _ Variable Value :  _ 3 _ 5.84365 VARIABLE 1 VARIABLE 2 3 3 5.84365 5.844 _
<  DECLARING VARIABLES  > #include<stdio.h> main( ) { int a=5, b=6, c=7, para;   para = a + b + c; printf(“PARAMETER :  %i ”,  para ); } _ PARAMETER _ 18 _ 5 6 7 0 5 6 7 18 18

More Related Content

PPT
Variable declaration
PPTX
Character set of c
PDF
Sap script system_symbol
PPTX
JAVA Literals
PPTX
C Programming Language Part 11
PPT
Ch 7-pointers
PPTX
Basic Input and Output
Variable declaration
Character set of c
Sap script system_symbol
JAVA Literals
C Programming Language Part 11
Ch 7-pointers
Basic Input and Output

What's hot (20)

PDF
9. pointer, pointer & function
PPTX
C Programming Language Part 9
PPTX
C Programming Language Part 8
PPTX
CHAPTER 2
PPTX
PL SQL Quiz | PL SQL Examples
PPT
scanf function in c, variations in conversion specifier
PDF
Chapter 3 - Variable Memory Concept
PPSX
C programming pointer
PPTX
Input output functions
PPTX
C language (more)
PPTX
Data Input and Output
PPTX
FLOWOFCONTROL-IF..ELSE PYTHON
PPT
Functions and pointers_unit_4
PPTX
FLOW OF CONTROL-INTRO PYTHON
PPT
Cbasic
PPT
Decision Making and Branching in C
PPTX
Decision making and branching
PPTX
C if else
DOC
2. operator
9. pointer, pointer & function
C Programming Language Part 9
C Programming Language Part 8
CHAPTER 2
PL SQL Quiz | PL SQL Examples
scanf function in c, variations in conversion specifier
Chapter 3 - Variable Memory Concept
C programming pointer
Input output functions
C language (more)
Data Input and Output
FLOWOFCONTROL-IF..ELSE PYTHON
Functions and pointers_unit_4
FLOW OF CONTROL-INTRO PYTHON
Cbasic
Decision Making and Branching in C
Decision making and branching
C if else
2. operator
Ad

Viewers also liked (8)

PPT
Introduction to turbo c
PPTX
Eestlased 2012 londoni olümpia mängudel3
PPT
Back to school photo slider
PPTX
Eestlased 2012 londoni olümpia mängudel3
PPSX
Renaissannce politicss, lit, and art-1
PPSX
Key answer to longtest (3 rd quarter)
PDF
49045118 project-of-coca-cola-110406035123-phpapp01(4)
PPSX
Industrial revolution
Introduction to turbo c
Eestlased 2012 londoni olümpia mängudel3
Back to school photo slider
Eestlased 2012 londoni olümpia mängudel3
Renaissannce politicss, lit, and art-1
Key answer to longtest (3 rd quarter)
49045118 project-of-coca-cola-110406035123-phpapp01(4)
Industrial revolution
Ad

Similar to Variable declaration (20)

PPT
C++ programming
PPTX
Lesson 4 Basic Programming Constructs.pptx
PPT
C PROGRAMMING BASICS- COMPUTER PROGRAMMING UNIT II
PDF
POLITEKNIK MALAYSIA
PPT
Presentation.mehr
PPTX
Introduction to C programming
PPTX
Cplusplus
PPTX
2. introduction of a c program
PDF
C language concept with code apna college.pdf
PPT
presentation_pointers_1444076066_140676 (1).ppt
PPT
c program.ppt
PPTX
C LANGUAGE.pptx
PPTX
C LANGUAGE.pptx
PPT
Lecture 3 c++
PDF
Cs211 module 1_2015
PDF
Cs211 module 1_2015
PPS
PHP Built-in String Validation Functions
PPT
Pengaturcaraan asas
PDF
PSPC--UNIT-2.pdf
C++ programming
Lesson 4 Basic Programming Constructs.pptx
C PROGRAMMING BASICS- COMPUTER PROGRAMMING UNIT II
POLITEKNIK MALAYSIA
Presentation.mehr
Introduction to C programming
Cplusplus
2. introduction of a c program
C language concept with code apna college.pdf
presentation_pointers_1444076066_140676 (1).ppt
c program.ppt
C LANGUAGE.pptx
C LANGUAGE.pptx
Lecture 3 c++
Cs211 module 1_2015
Cs211 module 1_2015
PHP Built-in String Validation Functions
Pengaturcaraan asas
PSPC--UNIT-2.pdf

More from Hanielle Cheng (20)

PPSX
4th quarter periodic test review in math3
PPSX
4th quarter periodic test review in trigonometry
PPSX
Quiz no.5
PPSX
World 4 th quarter outline
PPSX
The renaissance
PPSX
The reformation part i
PPSX
The industrial revolution 2
PDF
Scientific revolution
PPT
Scientific revolution 2
PPSX
Exploration and colonization
PPSX
Effects of exploration
PPSX
Effects of colonization
PPSX
Early renaissance 3
PPSX
Counter reformation
PPSX
Age of reason
PPSX
Columbian exchange
PPT
The high renaissance
PPT
Introduction to turbo c
PPT
Operators
PPT
Operators
4th quarter periodic test review in math3
4th quarter periodic test review in trigonometry
Quiz no.5
World 4 th quarter outline
The renaissance
The reformation part i
The industrial revolution 2
Scientific revolution
Scientific revolution 2
Exploration and colonization
Effects of exploration
Effects of colonization
Early renaissance 3
Counter reformation
Age of reason
Columbian exchange
The high renaissance
Introduction to turbo c
Operators
Operators

Recently uploaded (20)

PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
PPT
Geologic Time for studying geology for geologist
PPTX
Tartificialntelligence_presentation.pptx
PDF
STKI Israel Market Study 2025 version august
PPTX
Final SEM Unit 1 for mit wpu at pune .pptx
PPTX
Modernising the Digital Integration Hub
PDF
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
PDF
Hybrid model detection and classification of lung cancer
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PDF
DP Operators-handbook-extract for the Mautical Institute
PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
PPTX
O2C Customer Invoices to Receipt V15A.pptx
PDF
1 - Historical Antecedents, Social Consideration.pdf
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PPT
Module 1.ppt Iot fundamentals and Architecture
DOCX
search engine optimization ppt fir known well about this
PDF
Getting Started with Data Integration: FME Form 101
PDF
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
PDF
Architecture types and enterprise applications.pdf
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
Geologic Time for studying geology for geologist
Tartificialntelligence_presentation.pptx
STKI Israel Market Study 2025 version august
Final SEM Unit 1 for mit wpu at pune .pptx
Modernising the Digital Integration Hub
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
Hybrid model detection and classification of lung cancer
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
DP Operators-handbook-extract for the Mautical Institute
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
O2C Customer Invoices to Receipt V15A.pptx
1 - Historical Antecedents, Social Consideration.pdf
Assigned Numbers - 2025 - Bluetooth® Document
Group 1 Presentation -Planning and Decision Making .pptx
Module 1.ppt Iot fundamentals and Architecture
search engine optimization ppt fir known well about this
Getting Started with Data Integration: FME Form 101
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
Architecture types and enterprise applications.pdf

Variable declaration

  • 2. OBJECTIVES Discuss the different data types that can be used in Turbo-C Explain and evaluate the rules in naming variables Create the syntax of data types and variable names in Turbo-C Codes
  • 3. VARIABLE DECLARATION OF TURBO-C SYNTAX <data type> <variable name> char g ; int x , y , z ; float f=5.67 ; int x=10 ; char name[10] ;
  • 4. < DATA TYPES > int a whole number consisting of an optional sign (+ or -) followed by a sequence of digit can hold integer quantities that do not require a fractional component or decimal places occupies two bytes in the address ranges from –32768 to +32767
  • 5. < DATA TYPES > Types of int   long int takes up more space and can store large number ranges from –2147483648 to +2147483647 occupies 4 bytes unsigned int cannot be negative from 0 to 65536
  • 6. < DATA TYPES > float consists of an optional sign (+ or -), followed by one or more digits , a decimal point, and one or more further digits it can include an optional exponent ranging from 3.4 E –38 to 3.4 E +38 
  • 7. < DATA TYPES > double is a special float which can store more significant digits and have longer exponent ranges from 1.7E-308 to 1.7E+308 with 15 digits accuracy
  • 8. < DATA TYPES > char can be used to contain a single letter, digit, punctuation mark or control symbol recognized by the computer written enclosed within single quotation marks, but literals strings are enclosed in double quotation marks
  • 9. < DATA TYPES > char a character may be assigned an integer value between –128 and +127 unsigned char data type may be assigned an integer value from 0 to 255 char c; char b = ‘*’; char a[30]; char a = “apple”;
  • 10. < VARIABLE NAME > arvin#030709 buendia_arvin : ] superman superman arvin25 [email_address]
  • 11. < VARIABLE NAME > It must start with a letter or an underscore, with subsequent characters being letters, numbers, or the underscore _arvin superman 05buendia buendia05 %arvin *superman
  • 12. < VARIABLE NAME > A Turbo C Variable may consist of 63 characters, but only the first 32 are significant do_you_know_that_this_is_one_long_variable_name_but_still_valid do_you_know_that_this_is_one_long_variable_name_but_still_considered_as_invalid tamahome miyaka_mikaela rain_mikayla
  • 13. < VARIABLE NAME > A variable is case sensitive, that is, uppercase variables are treated differently   Variable “ SUM ” is different from variable “ sum ” Variable “ NetPay ” is different from variable “ NETpay ”
  • 14. < VARIABLE NAME > A variable cannot be the same as a Turbo C keyword. float elwin main ping dota printf
  • 15. < VARIABLE NAME > A variable cannot be the same as a Turbo C keyword. float elwin main ping dota printf
  • 16. < VARIABLE NAME > Variable names must be unique and descriptive   area sheverlou cute surname product churva
  • 17. < DECLARING VARIABLES > #include<stdio.h> main( ) { int peso;   printf(“Variable Value : %i ”, peso ); } _ Variable Value : _ 0 _ 0 0
  • 18. < DECLARING VARIABLES > #include<stdio.h> main( ) { char let;   printf(“Variable Value : %c ”, let ); } _ Variable Value : _ ả _ ả ả
  • 19. < DECLARING VARIABLES > #include<stdio.h> main( ) { int x,y; printf(“Variable Values : %i %d ”, x , y ); } _ Variable Value : _ 0 _ 0 VARIABLE 1 VARIABLE 2 0 0 0 0 _
  • 20. < DECLARING VARIABLES > #include<stdio.h> main( ) { float gross=5.84365; int age=3; printf(“Variable Values : %i %.3f ”, age , gross ); } _ Variable Value : _ 3 _ 5.84365 VARIABLE 1 VARIABLE 2 3 3 5.84365 5.844 _
  • 21. < DECLARING VARIABLES > #include<stdio.h> main( ) { int a=5, b=6, c=7, para;   para = a + b + c; printf(“PARAMETER : %i ”, para ); } _ PARAMETER _ 18 _ 5 6 7 0 5 6 7 18 18