SlideShare a Scribd company logo
Laxminarayan Sharma class:CO5G Roll No:
Code:
class Demo
{
public static void main(String args[])
{
System.out.println("Welcome to the first java program");
}
}
Output:
Laxminarayan Sharma class:CO5G Roll No:
Code:
class Add
{
public static void main(String args[])
{
int a=10,b=20,c=0;
c=a+b;
System.out.println("Addition of 10+20 is="+c);
a=30;
b=05;
c=a-b;
System.out.println("Substration of 30-05 is="+c);
a=5;
b=25;
c=b*a;
System.out.println("Multiplication of 25*5 is"+c);
float m=17,n=3,x=0;
x=m/n;
System.out.println("Division of 17/3 is"+x);
}
}
Output:
Laxminarayan Sharma class:CO5G Roll No:
Code:
class CmdInput
{
public static void main(String args[])
{
int a=Integer.parseInt(args[0]),b=Integer.parseInt(args[1]),c=0;
System.out.println("A="+a);
System.out.println("B="+b);
c=a+b;
System.out.println("Addition of A + B is ="+c);
}
}
Output:
Laxminarayan Sharma class:CO5G Roll No:
Code:
class Demo
{
public static void main(String args[])
{
System.out.println("Welcome");
System.out.println("To");
System.out.println("Java");
System.out.println("Programming");
}
}
Output:
Laxminarayan Sharma class:CO5G Roll No:
Code:
class Demo
{
public static void main(String args[])
{
System.out.print("Welcome");
System.out.println("To");
System.out.print("Java");
System.out.println("Programming");
}
}
Output:
Ad

Recommended

Exp 3
Exp 3
deepak kumar
 
Shan
Shan
mohdshanu
 
Bti1022 lab sheet 9 10
Bti1022 lab sheet 9 10
alish sha
 
Cse presentation ratul
Cse presentation ratul
Hassan Ratul
 
C++
C++
Raj vardhan
 
New microsoft office word document (2)
New microsoft office word document (2)
Syed Umair
 
openCypher Technology Compatibility Kit (TCK)
openCypher Technology Compatibility Kit (TCK)
openCypher
 
Wap to implement bitwise operators
Wap to implement bitwise operators
Harleen Sodhi
 
Chapter 1 : Balagurusamy_ Programming ANsI in C
Chapter 1 : Balagurusamy_ Programming ANsI in C
BUBT
 
matlab code of shifting and folding of two sequences
matlab code of shifting and folding of two sequences
Rakesh kumar jha
 
c++ exp 1 Suraj...pdf
c++ exp 1 Suraj...pdf
ayush616992
 
Periodic test
Periodic test
Amit Mishra
 
MATLAB CODE OF Shifting sequence
MATLAB CODE OF Shifting sequence
Rakesh kumar jha
 
QUEUE || FUNCTION WRITING BASED ON QUEUE || LINKED LIST || DATA STRUCTURE || ...
QUEUE || FUNCTION WRITING BASED ON QUEUE || LINKED LIST || DATA STRUCTURE || ...
AAKASH KUMAR
 
Incremental Feature Location and Identification in Source Code
Incremental Feature Location and Identification in Source Code
Hiroshi Kazato
 
Concept of c
Concept of c
Rohan Gajre
 
Programacion
Programacion
HenryMalave1
 
39927902 c-labmanual
39927902 c-labmanual
Srinivasa Babji Josyula
 
Runtime Monitoring of Stream Logic Formulae (Talk @ FPS 2015)
Runtime Monitoring of Stream Logic Formulae (Talk @ FPS 2015)
Sylvain Hallé
 
Quantifying Information Leaks via Model Counting Modulo Theories
Quantifying Information Leaks via Model Counting Modulo Theories
Quoc-Sang Phan
 
algorithmdivs
algorithmdivs
Divya Ravindran
 
Tech Talks @NSU: DLang: возможности языка и его применение
Tech Talks @NSU: DLang: возможности языка и его применение
Tech Talks @NSU
 
A formalization of complex event stream processing
A formalization of complex event stream processing
Sylvain Hallé
 
Fibonacci Series Program in C++
Fibonacci Series Program in C++
Hitesh Kumar
 
please sir i want to comments of every code what i do in eachline . in this w...
please sir i want to comments of every code what i do in eachline . in this w...
hwbloom27
 
Thesis PPT
Thesis PPT
Drew Ferkin
 
The Gender Binary & LGBTI People: Religious Myth and Medical Malpractice
The Gender Binary & LGBTI People: Religious Myth and Medical Malpractice
Veronica Drantz, PhD
 
Science grade 7 assesement Quarter I based on matatag curriculum
Science grade 7 assesement Quarter I based on matatag curriculum
BryanLebasnon1
 
Sujay Rao Mandavilli public profile June 2025.pdf
Sujay Rao Mandavilli public profile June 2025.pdf
Sujay Rao Mandavilli
 
We are Living in a Dangerous Multilingual World!
We are Living in a Dangerous Multilingual World!
Editions La Dondaine
 

More Related Content

What's hot (18)

Chapter 1 : Balagurusamy_ Programming ANsI in C
Chapter 1 : Balagurusamy_ Programming ANsI in C
BUBT
 
matlab code of shifting and folding of two sequences
matlab code of shifting and folding of two sequences
Rakesh kumar jha
 
c++ exp 1 Suraj...pdf
c++ exp 1 Suraj...pdf
ayush616992
 
Periodic test
Periodic test
Amit Mishra
 
MATLAB CODE OF Shifting sequence
MATLAB CODE OF Shifting sequence
Rakesh kumar jha
 
QUEUE || FUNCTION WRITING BASED ON QUEUE || LINKED LIST || DATA STRUCTURE || ...
QUEUE || FUNCTION WRITING BASED ON QUEUE || LINKED LIST || DATA STRUCTURE || ...
AAKASH KUMAR
 
Incremental Feature Location and Identification in Source Code
Incremental Feature Location and Identification in Source Code
Hiroshi Kazato
 
Concept of c
Concept of c
Rohan Gajre
 
Programacion
Programacion
HenryMalave1
 
39927902 c-labmanual
39927902 c-labmanual
Srinivasa Babji Josyula
 
Runtime Monitoring of Stream Logic Formulae (Talk @ FPS 2015)
Runtime Monitoring of Stream Logic Formulae (Talk @ FPS 2015)
Sylvain Hallé
 
Quantifying Information Leaks via Model Counting Modulo Theories
Quantifying Information Leaks via Model Counting Modulo Theories
Quoc-Sang Phan
 
algorithmdivs
algorithmdivs
Divya Ravindran
 
Tech Talks @NSU: DLang: возможности языка и его применение
Tech Talks @NSU: DLang: возможности языка и его применение
Tech Talks @NSU
 
A formalization of complex event stream processing
A formalization of complex event stream processing
Sylvain Hallé
 
Fibonacci Series Program in C++
Fibonacci Series Program in C++
Hitesh Kumar
 
please sir i want to comments of every code what i do in eachline . in this w...
please sir i want to comments of every code what i do in eachline . in this w...
hwbloom27
 
Thesis PPT
Thesis PPT
Drew Ferkin
 
Chapter 1 : Balagurusamy_ Programming ANsI in C
Chapter 1 : Balagurusamy_ Programming ANsI in C
BUBT
 
matlab code of shifting and folding of two sequences
matlab code of shifting and folding of two sequences
Rakesh kumar jha
 
c++ exp 1 Suraj...pdf
c++ exp 1 Suraj...pdf
ayush616992
 
MATLAB CODE OF Shifting sequence
MATLAB CODE OF Shifting sequence
Rakesh kumar jha
 
QUEUE || FUNCTION WRITING BASED ON QUEUE || LINKED LIST || DATA STRUCTURE || ...
QUEUE || FUNCTION WRITING BASED ON QUEUE || LINKED LIST || DATA STRUCTURE || ...
AAKASH KUMAR
 
Incremental Feature Location and Identification in Source Code
Incremental Feature Location and Identification in Source Code
Hiroshi Kazato
 
Runtime Monitoring of Stream Logic Formulae (Talk @ FPS 2015)
Runtime Monitoring of Stream Logic Formulae (Talk @ FPS 2015)
Sylvain Hallé
 
Quantifying Information Leaks via Model Counting Modulo Theories
Quantifying Information Leaks via Model Counting Modulo Theories
Quoc-Sang Phan
 
Tech Talks @NSU: DLang: возможности языка и его применение
Tech Talks @NSU: DLang: возможности языка и его применение
Tech Talks @NSU
 
A formalization of complex event stream processing
A formalization of complex event stream processing
Sylvain Hallé
 
Fibonacci Series Program in C++
Fibonacci Series Program in C++
Hitesh Kumar
 
please sir i want to comments of every code what i do in eachline . in this w...
please sir i want to comments of every code what i do in eachline . in this w...
hwbloom27
 

Recently uploaded (20)

The Gender Binary & LGBTI People: Religious Myth and Medical Malpractice
The Gender Binary & LGBTI People: Religious Myth and Medical Malpractice
Veronica Drantz, PhD
 
Science grade 7 assesement Quarter I based on matatag curriculum
Science grade 7 assesement Quarter I based on matatag curriculum
BryanLebasnon1
 
Sujay Rao Mandavilli public profile June 2025.pdf
Sujay Rao Mandavilli public profile June 2025.pdf
Sujay Rao Mandavilli
 
We are Living in a Dangerous Multilingual World!
We are Living in a Dangerous Multilingual World!
Editions La Dondaine
 
Enzyme Kinetics_Lecture 8.5.2025 Enzymology.pdf
Enzyme Kinetics_Lecture 8.5.2025 Enzymology.pdf
ayeshaalibukhari125
 
Overview of Stem Cells and Immune Modulation.ppsx
Overview of Stem Cells and Immune Modulation.ppsx
AhmedAtwa29
 
Science 8 Quarter 4 first quiz digestive system.docx
Science 8 Quarter 4 first quiz digestive system.docx
junefermunez
 
lysosomes "suicide bags of cell" and hydrolytic enzymes
lysosomes "suicide bags of cell" and hydrolytic enzymes
kchaturvedi070
 
HERBAL INGREDIENTS USED IN ORAL CARE.pptx
HERBAL INGREDIENTS USED IN ORAL CARE.pptx
Vidhi889356
 
Paired Sketching of Distributed User Interfaces:Workflow, Protocol, Software ...
Paired Sketching of Distributed User Interfaces:Workflow, Protocol, Software ...
Jean Vanderdonckt
 
An Analysis Of The Pearl Short Story By John Steinbeck
An Analysis Of The Pearl Short Story By John Steinbeck
BillyDarmawan3
 
What is Research Grade 7/ Research I.pptx
What is Research Grade 7/ Research I.pptx
delapenamhey144
 
GBSN_Unit 3 - Medical and surgical Asepsis
GBSN_Unit 3 - Medical and surgical Asepsis
Areesha Ahmad
 
It's about the habitat of organisms. Where they live and what they need to su...
It's about the habitat of organisms. Where they live and what they need to su...
KwabenaAbrokwah1
 
Relazione di laboratorio Idrolisi dell'amido (in inglese)
Relazione di laboratorio Idrolisi dell'amido (in inglese)
paolofvesco
 
STAPHYLOCOCCAL AND STREPTOCOCCAL INFECTIONS 2.ppt
STAPHYLOCOCCAL AND STREPTOCOCCAL INFECTIONS 2.ppt
pakranti27
 
GBSN__Unit 2 - Control of Microorganisms
GBSN__Unit 2 - Control of Microorganisms
Areesha Ahmad
 
The scientific heritage No 162 (162) (2025)
The scientific heritage No 162 (162) (2025)
The scientific heritage
 
Flexible Denture -Removable partial denture.pptx
Flexible Denture -Removable partial denture.pptx
Nekemiya
 
How Psychology Can Power Product Decisions: A Human-Centered Blueprint- Shray...
How Psychology Can Power Product Decisions: A Human-Centered Blueprint- Shray...
ShrayasiRoy2
 
The Gender Binary & LGBTI People: Religious Myth and Medical Malpractice
The Gender Binary & LGBTI People: Religious Myth and Medical Malpractice
Veronica Drantz, PhD
 
Science grade 7 assesement Quarter I based on matatag curriculum
Science grade 7 assesement Quarter I based on matatag curriculum
BryanLebasnon1
 
Sujay Rao Mandavilli public profile June 2025.pdf
Sujay Rao Mandavilli public profile June 2025.pdf
Sujay Rao Mandavilli
 
We are Living in a Dangerous Multilingual World!
We are Living in a Dangerous Multilingual World!
Editions La Dondaine
 
Enzyme Kinetics_Lecture 8.5.2025 Enzymology.pdf
Enzyme Kinetics_Lecture 8.5.2025 Enzymology.pdf
ayeshaalibukhari125
 
Overview of Stem Cells and Immune Modulation.ppsx
Overview of Stem Cells and Immune Modulation.ppsx
AhmedAtwa29
 
Science 8 Quarter 4 first quiz digestive system.docx
Science 8 Quarter 4 first quiz digestive system.docx
junefermunez
 
lysosomes "suicide bags of cell" and hydrolytic enzymes
lysosomes "suicide bags of cell" and hydrolytic enzymes
kchaturvedi070
 
HERBAL INGREDIENTS USED IN ORAL CARE.pptx
HERBAL INGREDIENTS USED IN ORAL CARE.pptx
Vidhi889356
 
Paired Sketching of Distributed User Interfaces:Workflow, Protocol, Software ...
Paired Sketching of Distributed User Interfaces:Workflow, Protocol, Software ...
Jean Vanderdonckt
 
An Analysis Of The Pearl Short Story By John Steinbeck
An Analysis Of The Pearl Short Story By John Steinbeck
BillyDarmawan3
 
What is Research Grade 7/ Research I.pptx
What is Research Grade 7/ Research I.pptx
delapenamhey144
 
GBSN_Unit 3 - Medical and surgical Asepsis
GBSN_Unit 3 - Medical and surgical Asepsis
Areesha Ahmad
 
It's about the habitat of organisms. Where they live and what they need to su...
It's about the habitat of organisms. Where they live and what they need to su...
KwabenaAbrokwah1
 
Relazione di laboratorio Idrolisi dell'amido (in inglese)
Relazione di laboratorio Idrolisi dell'amido (in inglese)
paolofvesco
 
STAPHYLOCOCCAL AND STREPTOCOCCAL INFECTIONS 2.ppt
STAPHYLOCOCCAL AND STREPTOCOCCAL INFECTIONS 2.ppt
pakranti27
 
GBSN__Unit 2 - Control of Microorganisms
GBSN__Unit 2 - Control of Microorganisms
Areesha Ahmad
 
The scientific heritage No 162 (162) (2025)
The scientific heritage No 162 (162) (2025)
The scientific heritage
 
Flexible Denture -Removable partial denture.pptx
Flexible Denture -Removable partial denture.pptx
Nekemiya
 
How Psychology Can Power Product Decisions: A Human-Centered Blueprint- Shray...
How Psychology Can Power Product Decisions: A Human-Centered Blueprint- Shray...
ShrayasiRoy2
 
Ad

Introduction to java Programming, Addition, Substraction, Multiplication, Division

  • 1. Laxminarayan Sharma class:CO5G Roll No: Code: class Demo { public static void main(String args[]) { System.out.println("Welcome to the first java program"); } } Output:
  • 2. Laxminarayan Sharma class:CO5G Roll No: Code: class Add { public static void main(String args[]) { int a=10,b=20,c=0; c=a+b; System.out.println("Addition of 10+20 is="+c); a=30; b=05; c=a-b; System.out.println("Substration of 30-05 is="+c); a=5; b=25; c=b*a; System.out.println("Multiplication of 25*5 is"+c); float m=17,n=3,x=0; x=m/n; System.out.println("Division of 17/3 is"+x); } } Output:
  • 3. Laxminarayan Sharma class:CO5G Roll No: Code: class CmdInput { public static void main(String args[]) { int a=Integer.parseInt(args[0]),b=Integer.parseInt(args[1]),c=0; System.out.println("A="+a); System.out.println("B="+b); c=a+b; System.out.println("Addition of A + B is ="+c); } } Output:
  • 4. Laxminarayan Sharma class:CO5G Roll No: Code: class Demo { public static void main(String args[]) { System.out.println("Welcome"); System.out.println("To"); System.out.println("Java"); System.out.println("Programming"); } } Output:
  • 5. Laxminarayan Sharma class:CO5G Roll No: Code: class Demo { public static void main(String args[]) { System.out.print("Welcome"); System.out.println("To"); System.out.print("Java"); System.out.println("Programming"); } } Output: