SlideShare a Scribd company logo
RULES FOR VARIABLE
DECLARATION
RULES FOR VARIABLE DECLARATION
O Variable name only start with a letter, an underscore ( _ ), of a dollar sign
( $ ).
O The variable name should start with only letters
O White spaces are not allowed between characters of variable but
undersores are approved.
O The variable name is case sensitive –TEMP and temp is different
variable.
O No two variables of same name are allowed to be declared in the same
scope.
O Every variable used must be declared.
O Javascript allows declaration statements anywhere in the list of
statements.
O Variable declarations announce what variables will be used in the
program.
O A variable must be declared before it can be used.
O Declaration statements can also be used to store an initial value into
declared variables.
O Variable name cannot start with a number.
RULES FOR VARIABLE DECLARATION
O In java a variable name cannot start with a didit or hyphen.
O Al variable can be “31” character long for many compiler.
O Key word are not used as variable name.
O Blank spaces special symbols commas are not used.
O The first letter of the variable must be character of
underscore.
O The java languafe is case sensitive which implies that the
variable num in lowercase is different from variable num in
upper case.
O Declaring an initial value of variable in the declaration
statement is optional.
O Variable may be declared in a list.
O Both lower case and higher case digits are distinct.
Purpose of lab 1
O It was a general lab. In lab 1 we have studied about
of python and learned about how to join google class.
O Program 1:
O This program will display my name.
O Code: Print (“Shaher Bano”)
O Output:
O Mr. Usman
O Program 2:
O This program will display members of my family.
O Code: Print (“there are four members in my family.”)
O Output:
O there are four members in my family.
Program 3:
O This program will display the table of two.
Code:
O Print (“2x1=2”)
O Print (“2x2=4”)
O Print (“2x3=6”)
O Print (“2x4=8”)
O Print (“2x5=10”)
O Print (“2x6=12”)
O Print (“2x7=14”)
O Print (“2x8=16”)
O Print (“2x9=18”)
O Print (“2x10=20”)
Output:
O 2x1=2
O 2x2=4
O 2x3=6
O 2x4=8
O 2x5=10
O 2x6=12
O 2x7=14
O 2x8=16
O 2x9=18
O 2x10=20
O Program 4:
O This program will display my favorite book.
O Code: Print (“Mathematics”)
O Output:
O Mathematics
O Program 5:
O This program will display the addition of three
digits.
O Code: Print (“2+2+3”)
O Output:
O 2+2+3
Thanks you…..

More Related Content

What's hot

C if else
C if elseC if else
C if else
Ritwik Das
 
Inheritance in java
Inheritance in javaInheritance in java
Inheritance in javaTech_MX
 
Nondeterministic Finite Automata
Nondeterministic Finite AutomataNondeterministic Finite Automata
Nondeterministic Finite AutomataAdel Al-Ofairi
 
Function overloading(c++)
Function overloading(c++)Function overloading(c++)
Function overloading(c++)
Ritika Sharma
 
Intro to assembly language
Intro to assembly languageIntro to assembly language
Intro to assembly language
United International University
 
Inheritance in java
Inheritance in javaInheritance in java
Inheritance in java
RahulAnanda1
 
10. switch case
10. switch case10. switch case
10. switch case
Way2itech
 
Java and its features
Java and its featuresJava and its features
Java and its features
Pydi Nikhil
 
data types in C programming
data types in C programmingdata types in C programming
data types in C programming
Harshita Yadav
 
Abstract class in java
Abstract class in javaAbstract class in java
Abstract class in java
Lovely Professional University
 
Karnaugh map
Karnaugh mapKarnaugh map
Karnaugh map
Vanitha Chandru
 
Function overloading and overriding
Function overloading and overridingFunction overloading and overriding
Function overloading and overriding
Rajab Ali
 
C program compiler presentation
C program compiler presentationC program compiler presentation
C program compiler presentation
Rigvendra Kumar Vardhan
 
Deterministic Finite Automata (DFA)
Deterministic Finite Automata (DFA)Deterministic Finite Automata (DFA)
Deterministic Finite Automata (DFA)
Animesh Chaturvedi
 
Parsing in Compiler Design
Parsing in Compiler DesignParsing in Compiler Design
Parsing in Compiler Design
Akhil Kaushik
 
classes and objects in C++
classes and objects in C++classes and objects in C++
classes and objects in C++
HalaiHansaika
 
Static Data Members and Member Functions
Static Data Members and Member FunctionsStatic Data Members and Member Functions
Static Data Members and Member Functions
MOHIT AGARWAL
 
friend function(c++)
friend function(c++)friend function(c++)
friend function(c++)
Ritika Sharma
 
Python programming : Control statements
Python programming : Control statementsPython programming : Control statements
Python programming : Control statements
Emertxe Information Technologies Pvt Ltd
 

What's hot (20)

C if else
C if elseC if else
C if else
 
Inheritance in java
Inheritance in javaInheritance in java
Inheritance in java
 
Nondeterministic Finite Automata
Nondeterministic Finite AutomataNondeterministic Finite Automata
Nondeterministic Finite Automata
 
Function overloading(c++)
Function overloading(c++)Function overloading(c++)
Function overloading(c++)
 
Intro to assembly language
Intro to assembly languageIntro to assembly language
Intro to assembly language
 
Inheritance in java
Inheritance in javaInheritance in java
Inheritance in java
 
10. switch case
10. switch case10. switch case
10. switch case
 
Java and its features
Java and its featuresJava and its features
Java and its features
 
data types in C programming
data types in C programmingdata types in C programming
data types in C programming
 
Abstract class in java
Abstract class in javaAbstract class in java
Abstract class in java
 
Karnaugh map
Karnaugh mapKarnaugh map
Karnaugh map
 
Function overloading and overriding
Function overloading and overridingFunction overloading and overriding
Function overloading and overriding
 
C program compiler presentation
C program compiler presentationC program compiler presentation
C program compiler presentation
 
Deterministic Finite Automata (DFA)
Deterministic Finite Automata (DFA)Deterministic Finite Automata (DFA)
Deterministic Finite Automata (DFA)
 
Parsing in Compiler Design
Parsing in Compiler DesignParsing in Compiler Design
Parsing in Compiler Design
 
classes and objects in C++
classes and objects in C++classes and objects in C++
classes and objects in C++
 
Static Data Members and Member Functions
Static Data Members and Member FunctionsStatic Data Members and Member Functions
Static Data Members and Member Functions
 
friend function(c++)
friend function(c++)friend function(c++)
friend function(c++)
 
Python programming : Control statements
Python programming : Control statementsPython programming : Control statements
Python programming : Control statements
 
Function in C program
Function in C programFunction in C program
Function in C program
 

Similar to Rules for Variable Declaration

Java: Primitive Data Types
Java: Primitive Data TypesJava: Primitive Data Types
Java: Primitive Data Types
Tareq Hasan
 
What is the general format for a Try-Catch block Assume that amt l .docx
 What is the general format for a Try-Catch block  Assume that amt l .docx What is the general format for a Try-Catch block  Assume that amt l .docx
What is the general format for a Try-Catch block Assume that amt l .docx
ajoy21
 
Escape Sequences and Variables
Escape Sequences and VariablesEscape Sequences and Variables
Escape Sequences and Variables
yarkhosh
 
JavaScript: Core Part
JavaScript: Core PartJavaScript: Core Part
JavaScript: Core Part
維佋 唐
 
Jas_python.pptx for beginners introduction
Jas_python.pptx for beginners introductionJas_python.pptx for beginners introduction
Jas_python.pptx for beginners introduction
JaspreetKaur410261
 
1_1_python-course-notes-sections-1-7.pdf
1_1_python-course-notes-sections-1-7.pdf1_1_python-course-notes-sections-1-7.pdf
1_1_python-course-notes-sections-1-7.pdf
Javier Crisostomo
 
C programming perso notes
C programming perso notesC programming perso notes
C programming perso notesMelanie Tsopze
 
perl 6 hands-on tutorial
perl 6 hands-on tutorialperl 6 hands-on tutorial
perl 6 hands-on tutorial
mustafa sarac
 
Introduction To Python
Introduction To  PythonIntroduction To  Python
Introduction To Pythonshailaja30
 
Tutorial perl programming basic eng ver
Tutorial perl programming basic eng verTutorial perl programming basic eng ver
Tutorial perl programming basic eng ver
Qrembiezs Intruder
 
OpenGurukul : Language : C Programming
OpenGurukul : Language : C ProgrammingOpenGurukul : Language : C Programming
OpenGurukul : Language : C Programming
Open Gurukul
 
Fortran 90 Basics
Fortran 90 BasicsFortran 90 Basics
Fortran 90 Basics
Tariqul Dipu
 
Data Types, Variables, and Operators
Data Types, Variables, and OperatorsData Types, Variables, and Operators
Data Types, Variables, and Operators
Marwa Ali Eissa
 
Variables
VariablesVariables
Variables
Suraj Motee
 
7-Java Language Basics Part1
7-Java Language Basics Part17-Java Language Basics Part1
7-Java Language Basics Part1
Amr Elghadban (AmrAngry)
 
The Java Script Programming Language
The  Java Script  Programming  LanguageThe  Java Script  Programming  Language
The Java Script Programming Languagezone
 
Javascript
JavascriptJavascript
Javascript
guest03a6e6
 

Similar to Rules for Variable Declaration (20)

Java: Primitive Data Types
Java: Primitive Data TypesJava: Primitive Data Types
Java: Primitive Data Types
 
How to Program
How to ProgramHow to Program
How to Program
 
What is the general format for a Try-Catch block Assume that amt l .docx
 What is the general format for a Try-Catch block  Assume that amt l .docx What is the general format for a Try-Catch block  Assume that amt l .docx
What is the general format for a Try-Catch block Assume that amt l .docx
 
Escape Sequences and Variables
Escape Sequences and VariablesEscape Sequences and Variables
Escape Sequences and Variables
 
JavaScript: Core Part
JavaScript: Core PartJavaScript: Core Part
JavaScript: Core Part
 
Jas_python.pptx for beginners introduction
Jas_python.pptx for beginners introductionJas_python.pptx for beginners introduction
Jas_python.pptx for beginners introduction
 
1_1_python-course-notes-sections-1-7.pdf
1_1_python-course-notes-sections-1-7.pdf1_1_python-course-notes-sections-1-7.pdf
1_1_python-course-notes-sections-1-7.pdf
 
Php
PhpPhp
Php
 
C programming perso notes
C programming perso notesC programming perso notes
C programming perso notes
 
perl 6 hands-on tutorial
perl 6 hands-on tutorialperl 6 hands-on tutorial
perl 6 hands-on tutorial
 
Introduction To Python
Introduction To  PythonIntroduction To  Python
Introduction To Python
 
Tutorial perl programming basic eng ver
Tutorial perl programming basic eng verTutorial perl programming basic eng ver
Tutorial perl programming basic eng ver
 
OpenGurukul : Language : C Programming
OpenGurukul : Language : C ProgrammingOpenGurukul : Language : C Programming
OpenGurukul : Language : C Programming
 
Fortran 90 Basics
Fortran 90 BasicsFortran 90 Basics
Fortran 90 Basics
 
Data Types, Variables, and Operators
Data Types, Variables, and OperatorsData Types, Variables, and Operators
Data Types, Variables, and Operators
 
Variables
VariablesVariables
Variables
 
Javascript
JavascriptJavascript
Javascript
 
7-Java Language Basics Part1
7-Java Language Basics Part17-Java Language Basics Part1
7-Java Language Basics Part1
 
The Java Script Programming Language
The  Java Script  Programming  LanguageThe  Java Script  Programming  Language
The Java Script Programming Language
 
Javascript
JavascriptJavascript
Javascript
 

More from uniprint

School Management App in order to perform all the tasks in a controlled and s...
School Management App in order to perform all the tasks in a controlled and s...School Management App in order to perform all the tasks in a controlled and s...
School Management App in order to perform all the tasks in a controlled and s...
uniprint
 
Halal status of carbonated drinks
Halal status of carbonated drinksHalal status of carbonated drinks
Halal status of carbonated drinks
uniprint
 
Cognitive behavioral therapy (CBT)
Cognitive behavioral therapy (CBT)Cognitive behavioral therapy (CBT)
Cognitive behavioral therapy (CBT)
uniprint
 
Women after giving birth to a child is backache (fix bad back visit https://b...
Women after giving birth to a child is backache (fix bad back visit https://b...Women after giving birth to a child is backache (fix bad back visit https://b...
Women after giving birth to a child is backache (fix bad back visit https://b...
uniprint
 
WILD ANIMALS OF PAKISTAN
WILD ANIMALS OF PAKISTANWILD ANIMALS OF PAKISTAN
WILD ANIMALS OF PAKISTAN
uniprint
 
Management Structure & Communication in School
Management Structure & Communication in SchoolManagement Structure & Communication in School
Management Structure & Communication in School
uniprint
 
Immune System
Immune SystemImmune System
Immune System
uniprint
 
Cortisol impact in Diseases and Medication
Cortisol impact in Diseases and MedicationCortisol impact in Diseases and Medication
Cortisol impact in Diseases and Medication
uniprint
 
Instructional and Communication Technology
Instructional and Communication TechnologyInstructional and Communication Technology
Instructional and Communication Technology
uniprint
 
INSTRUCTIONAL & COMMUNICATION TECHNOLOGY
INSTRUCTIONAL & COMMUNICATION TECHNOLOGYINSTRUCTIONAL & COMMUNICATION TECHNOLOGY
INSTRUCTIONAL & COMMUNICATION TECHNOLOGY
uniprint
 
Primary and secondary sources on critical thinking
Primary and secondary sources on critical thinkingPrimary and secondary sources on critical thinking
Primary and secondary sources on critical thinking
uniprint
 
Emotional development
Emotional developmentEmotional development
Emotional development
uniprint
 
Abnormal Psychology (Psychiatric history) Case Study
Abnormal Psychology (Psychiatric history) Case StudyAbnormal Psychology (Psychiatric history) Case Study
Abnormal Psychology (Psychiatric history) Case Study
uniprint
 
Teaching prose and poems
Teaching prose and poemsTeaching prose and poems
Teaching prose and poems
uniprint
 

More from uniprint (14)

School Management App in order to perform all the tasks in a controlled and s...
School Management App in order to perform all the tasks in a controlled and s...School Management App in order to perform all the tasks in a controlled and s...
School Management App in order to perform all the tasks in a controlled and s...
 
Halal status of carbonated drinks
Halal status of carbonated drinksHalal status of carbonated drinks
Halal status of carbonated drinks
 
Cognitive behavioral therapy (CBT)
Cognitive behavioral therapy (CBT)Cognitive behavioral therapy (CBT)
Cognitive behavioral therapy (CBT)
 
Women after giving birth to a child is backache (fix bad back visit https://b...
Women after giving birth to a child is backache (fix bad back visit https://b...Women after giving birth to a child is backache (fix bad back visit https://b...
Women after giving birth to a child is backache (fix bad back visit https://b...
 
WILD ANIMALS OF PAKISTAN
WILD ANIMALS OF PAKISTANWILD ANIMALS OF PAKISTAN
WILD ANIMALS OF PAKISTAN
 
Management Structure & Communication in School
Management Structure & Communication in SchoolManagement Structure & Communication in School
Management Structure & Communication in School
 
Immune System
Immune SystemImmune System
Immune System
 
Cortisol impact in Diseases and Medication
Cortisol impact in Diseases and MedicationCortisol impact in Diseases and Medication
Cortisol impact in Diseases and Medication
 
Instructional and Communication Technology
Instructional and Communication TechnologyInstructional and Communication Technology
Instructional and Communication Technology
 
INSTRUCTIONAL & COMMUNICATION TECHNOLOGY
INSTRUCTIONAL & COMMUNICATION TECHNOLOGYINSTRUCTIONAL & COMMUNICATION TECHNOLOGY
INSTRUCTIONAL & COMMUNICATION TECHNOLOGY
 
Primary and secondary sources on critical thinking
Primary and secondary sources on critical thinkingPrimary and secondary sources on critical thinking
Primary and secondary sources on critical thinking
 
Emotional development
Emotional developmentEmotional development
Emotional development
 
Abnormal Psychology (Psychiatric history) Case Study
Abnormal Psychology (Psychiatric history) Case StudyAbnormal Psychology (Psychiatric history) Case Study
Abnormal Psychology (Psychiatric history) Case Study
 
Teaching prose and poems
Teaching prose and poemsTeaching prose and poems
Teaching prose and poems
 

Recently uploaded

Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
gb193092
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
kimdan468
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
deeptiverma2406
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
Mohammed Sikander
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 

Recently uploaded (20)

Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 

Rules for Variable Declaration

  • 2. RULES FOR VARIABLE DECLARATION O Variable name only start with a letter, an underscore ( _ ), of a dollar sign ( $ ). O The variable name should start with only letters O White spaces are not allowed between characters of variable but undersores are approved. O The variable name is case sensitive –TEMP and temp is different variable. O No two variables of same name are allowed to be declared in the same scope. O Every variable used must be declared. O Javascript allows declaration statements anywhere in the list of statements. O Variable declarations announce what variables will be used in the program. O A variable must be declared before it can be used. O Declaration statements can also be used to store an initial value into declared variables. O Variable name cannot start with a number.
  • 3. RULES FOR VARIABLE DECLARATION O In java a variable name cannot start with a didit or hyphen. O Al variable can be “31” character long for many compiler. O Key word are not used as variable name. O Blank spaces special symbols commas are not used. O The first letter of the variable must be character of underscore. O The java languafe is case sensitive which implies that the variable num in lowercase is different from variable num in upper case. O Declaring an initial value of variable in the declaration statement is optional. O Variable may be declared in a list. O Both lower case and higher case digits are distinct.
  • 4. Purpose of lab 1 O It was a general lab. In lab 1 we have studied about of python and learned about how to join google class. O Program 1: O This program will display my name. O Code: Print (“Shaher Bano”) O Output: O Mr. Usman O Program 2: O This program will display members of my family. O Code: Print (“there are four members in my family.”) O Output: O there are four members in my family.
  • 5. Program 3: O This program will display the table of two. Code: O Print (“2x1=2”) O Print (“2x2=4”) O Print (“2x3=6”) O Print (“2x4=8”) O Print (“2x5=10”) O Print (“2x6=12”) O Print (“2x7=14”) O Print (“2x8=16”) O Print (“2x9=18”) O Print (“2x10=20”)
  • 6. Output: O 2x1=2 O 2x2=4 O 2x3=6 O 2x4=8 O 2x5=10 O 2x6=12 O 2x7=14 O 2x8=16 O 2x9=18 O 2x10=20
  • 7. O Program 4: O This program will display my favorite book. O Code: Print (“Mathematics”) O Output: O Mathematics O Program 5: O This program will display the addition of three digits. O Code: Print (“2+2+3”) O Output: O 2+2+3