SlideShare a Scribd company logo
1 of 4
Download to read offline
CODE:
import java.util.*;
public class test {
public static void main(String args[]) {
int num, sum=0;
Scanner input=new Scanner(System.in);
System.out.print("Input num : ");
num=input.nextInt();
while(num != 13) {
sum=sum+num;
System.out.print("Input num : ");
num=input.nextInt();
}
sum=sum+num;
System.out.println("Sum = "+sum);
}
}
save the above file as test.java
Output:
javac test.java
java test
Input num :
1
Input num :
2
Input num :
3
Input num :
4
Input num :
5
Input num :
6
Input num :
7
Input num :
8
Input num :
9
Input num :
0
Input num :
13
Sum = 58
Solution
CODE:
import java.util.*;
public class test {
public static void main(String args[]) {
int num, sum=0;
Scanner input=new Scanner(System.in);
System.out.print("Input num : ");
num=input.nextInt();
while(num != 13) {
sum=sum+num;
System.out.print("Input num : ");
num=input.nextInt();
}
sum=sum+num;
System.out.println("Sum = "+sum);
}
}
save the above file as test.java
Output:
javac test.java
java test
Input num :
1
Input num :
2
Input num :
3
Input num :
4
Input num :
5
Input num :
6
Input num :
7
Input num :
8
Input num :
9
Input num :
0
Input num :
13
Sum = 58

More Related Content

Similar to CODEimport java.util.; public class test { public static voi.pdf

MagicSquareTest.java import java.util.Scanner;public class Mag.pdf
MagicSquareTest.java import java.util.Scanner;public class Mag.pdfMagicSquareTest.java import java.util.Scanner;public class Mag.pdf
MagicSquareTest.java import java.util.Scanner;public class Mag.pdfanjanacottonmills
 
Lab01.pptx
Lab01.pptxLab01.pptx
Lab01.pptxKimVeeL
 
Codeimport java.util.Random; import java.util.Scanner;public .pdf
Codeimport java.util.Random; import java.util.Scanner;public .pdfCodeimport java.util.Random; import java.util.Scanner;public .pdf
Codeimport java.util.Random; import java.util.Scanner;public .pdfanupamfootwear
 
Prompt a user to enter a series of integers separated by spaces and .pdf
Prompt a user to enter a series of integers separated by spaces and .pdfPrompt a user to enter a series of integers separated by spaces and .pdf
Prompt a user to enter a series of integers separated by spaces and .pdfFootageetoffe16
 
Problem1 java codeimport java.util.Scanner; Java code to pr.pdf
 Problem1 java codeimport java.util.Scanner; Java code to pr.pdf Problem1 java codeimport java.util.Scanner; Java code to pr.pdf
Problem1 java codeimport java.util.Scanner; Java code to pr.pdfanupamfootwear
 
Throwing.javaimport java.util.InputMismatchException; import jav.pdf
Throwing.javaimport java.util.InputMismatchException; import jav.pdfThrowing.javaimport java.util.InputMismatchException; import jav.pdf
Throwing.javaimport java.util.InputMismatchException; import jav.pdfaquazac
 
9)Answerimport java.util.; import java.lang.; import java.pdf
9)Answerimport java.util.; import java.lang.; import java.pdf9)Answerimport java.util.; import java.lang.; import java.pdf
9)Answerimport java.util.; import java.lang.; import java.pdfanandf0099
 
import java.uti-WPS Office.docx
import java.uti-WPS Office.docximport java.uti-WPS Office.docx
import java.uti-WPS Office.docxKatecate1
 
Core java pract_sem iii
Core java pract_sem iiiCore java pract_sem iii
Core java pract_sem iiiNiraj Bharambe
 

Similar to CODEimport java.util.; public class test { public static voi.pdf (15)

MagicSquareTest.java import java.util.Scanner;public class Mag.pdf
MagicSquareTest.java import java.util.Scanner;public class Mag.pdfMagicSquareTest.java import java.util.Scanner;public class Mag.pdf
MagicSquareTest.java import java.util.Scanner;public class Mag.pdf
 
Lab01.pptx
Lab01.pptxLab01.pptx
Lab01.pptx
 
Oot practical
Oot practicalOot practical
Oot practical
 
Java programs
Java programsJava programs
Java programs
 
Codeimport java.util.Random; import java.util.Scanner;public .pdf
Codeimport java.util.Random; import java.util.Scanner;public .pdfCodeimport java.util.Random; import java.util.Scanner;public .pdf
Codeimport java.util.Random; import java.util.Scanner;public .pdf
 
Prompt a user to enter a series of integers separated by spaces and .pdf
Prompt a user to enter a series of integers separated by spaces and .pdfPrompt a user to enter a series of integers separated by spaces and .pdf
Prompt a user to enter a series of integers separated by spaces and .pdf
 
Problem1 java codeimport java.util.Scanner; Java code to pr.pdf
 Problem1 java codeimport java.util.Scanner; Java code to pr.pdf Problem1 java codeimport java.util.Scanner; Java code to pr.pdf
Problem1 java codeimport java.util.Scanner; Java code to pr.pdf
 
Throwing.javaimport java.util.InputMismatchException; import jav.pdf
Throwing.javaimport java.util.InputMismatchException; import jav.pdfThrowing.javaimport java.util.InputMismatchException; import jav.pdf
Throwing.javaimport java.util.InputMismatchException; import jav.pdf
 
Java -lec-5
Java -lec-5Java -lec-5
Java -lec-5
 
LAB1.docx
LAB1.docxLAB1.docx
LAB1.docx
 
3.Lesson Plan - Input.pdf.pdf
3.Lesson Plan - Input.pdf.pdf3.Lesson Plan - Input.pdf.pdf
3.Lesson Plan - Input.pdf.pdf
 
9)Answerimport java.util.; import java.lang.; import java.pdf
9)Answerimport java.util.; import java.lang.; import java.pdf9)Answerimport java.util.; import java.lang.; import java.pdf
9)Answerimport java.util.; import java.lang.; import java.pdf
 
Java practical
Java practicalJava practical
Java practical
 
import java.uti-WPS Office.docx
import java.uti-WPS Office.docximport java.uti-WPS Office.docx
import java.uti-WPS Office.docx
 
Core java pract_sem iii
Core java pract_sem iiiCore java pract_sem iii
Core java pract_sem iii
 

More from anurag1231

a. The alleles are as followsaa - AlbinismAa AA - Normal pigm.pdf
a. The alleles are as followsaa - AlbinismAa  AA - Normal pigm.pdfa. The alleles are as followsaa - AlbinismAa  AA - Normal pigm.pdf
a. The alleles are as followsaa - AlbinismAa AA - Normal pigm.pdfanurag1231
 
9933Solution9933.pdf
9933Solution9933.pdf9933Solution9933.pdf
9933Solution9933.pdfanurag1231
 
49) sensation is what we receive through senses and perception is wh.pdf
49) sensation is what we receive through senses and perception is wh.pdf49) sensation is what we receive through senses and perception is wh.pdf
49) sensation is what we receive through senses and perception is wh.pdfanurag1231
 
1. INTRODUCTIONWe are currently living in the so-called informatio.pdf
1. INTRODUCTIONWe are currently living in the so-called informatio.pdf1. INTRODUCTIONWe are currently living in the so-called informatio.pdf
1. INTRODUCTIONWe are currently living in the so-called informatio.pdfanurag1231
 
1. d.) Organisms using oxygenic photosynthesis release oxygen into t.pdf
1. d.) Organisms using oxygenic photosynthesis release oxygen into t.pdf1. d.) Organisms using oxygenic photosynthesis release oxygen into t.pdf
1. d.) Organisms using oxygenic photosynthesis release oxygen into t.pdfanurag1231
 
1. All RTKs have a similar molecular architecture, with a ligand-bin.pdf
1. All RTKs have a similar molecular architecture, with a ligand-bin.pdf1. All RTKs have a similar molecular architecture, with a ligand-bin.pdf
1. All RTKs have a similar molecular architecture, with a ligand-bin.pdfanurag1231
 
1)we can see the universe mostly in the form hydrogen and helium. .pdf
1)we can see the universe mostly in the form hydrogen and helium. .pdf1)we can see the universe mostly in the form hydrogen and helium. .pdf
1)we can see the universe mostly in the form hydrogen and helium. .pdfanurag1231
 
1)D. Bacteria.2)B. Nuclear envelope3)A. Similar in function and .pdf
1)D. Bacteria.2)B. Nuclear envelope3)A. Similar in function and .pdf1)D. Bacteria.2)B. Nuclear envelope3)A. Similar in function and .pdf
1)D. Bacteria.2)B. Nuclear envelope3)A. Similar in function and .pdfanurag1231
 
1) Pen R contains penicillin resistance gene .Usually + or - is not .pdf
1) Pen R contains penicillin resistance gene .Usually + or - is not .pdf1) Pen R contains penicillin resistance gene .Usually + or - is not .pdf
1) Pen R contains penicillin resistance gene .Usually + or - is not .pdfanurag1231
 
0.8726Solution0.8726.pdf
0.8726Solution0.8726.pdf0.8726Solution0.8726.pdf
0.8726Solution0.8726.pdfanurag1231
 
UV radiation has shorter wavelength than visible .pdf
                     UV radiation has shorter wavelength than visible .pdf                     UV radiation has shorter wavelength than visible .pdf
UV radiation has shorter wavelength than visible .pdfanurag1231
 
(1) CA genetic model organism needs to have all the above features.pdf
(1) CA genetic model organism needs to have all the above features.pdf(1) CA genetic model organism needs to have all the above features.pdf
(1) CA genetic model organism needs to have all the above features.pdfanurag1231
 
The relation in partSolution The relation in part.pdf
 The relation in partSolution The relation in part.pdf The relation in partSolution The relation in part.pdf
The relation in partSolution The relation in part.pdfanurag1231
 
Step1 Concentration of hydroxide ion = 2x.00500=..pdf
                     Step1 Concentration of hydroxide ion = 2x.00500=..pdf                     Step1 Concentration of hydroxide ion = 2x.00500=..pdf
Step1 Concentration of hydroxide ion = 2x.00500=..pdfanurag1231
 
molality = (11258.5)1 = 1.914 m Percent mass =.pdf
                     molality = (11258.5)1 = 1.914 m  Percent mass =.pdf                     molality = (11258.5)1 = 1.914 m  Percent mass =.pdf
molality = (11258.5)1 = 1.914 m Percent mass =.pdfanurag1231
 
NADPH is a reducing agent that act as an electron.pdf
                     NADPH is a reducing agent that act as an electron.pdf                     NADPH is a reducing agent that act as an electron.pdf
NADPH is a reducing agent that act as an electron.pdfanurag1231
 
moleculesions geometry hybridization ClF3 T-shap.pdf
                     moleculesions geometry hybridization ClF3 T-shap.pdf                     moleculesions geometry hybridization ClF3 T-shap.pdf
moleculesions geometry hybridization ClF3 T-shap.pdfanurag1231
 
The major shortcoming was that the electrons were.pdf
                     The major shortcoming was that the electrons were.pdf                     The major shortcoming was that the electrons were.pdf
The major shortcoming was that the electrons were.pdfanurag1231
 
The ball is an atom, the stick is a bond. You pu.pdf
                     The ball is an atom, the stick is a bond.  You pu.pdf                     The ball is an atom, the stick is a bond.  You pu.pdf
The ball is an atom, the stick is a bond. You pu.pdfanurag1231
 
The anion is a good leaving group because it is p.pdf
                     The anion is a good leaving group because it is p.pdf                     The anion is a good leaving group because it is p.pdf
The anion is a good leaving group because it is p.pdfanurag1231
 

More from anurag1231 (20)

a. The alleles are as followsaa - AlbinismAa AA - Normal pigm.pdf
a. The alleles are as followsaa - AlbinismAa  AA - Normal pigm.pdfa. The alleles are as followsaa - AlbinismAa  AA - Normal pigm.pdf
a. The alleles are as followsaa - AlbinismAa AA - Normal pigm.pdf
 
9933Solution9933.pdf
9933Solution9933.pdf9933Solution9933.pdf
9933Solution9933.pdf
 
49) sensation is what we receive through senses and perception is wh.pdf
49) sensation is what we receive through senses and perception is wh.pdf49) sensation is what we receive through senses and perception is wh.pdf
49) sensation is what we receive through senses and perception is wh.pdf
 
1. INTRODUCTIONWe are currently living in the so-called informatio.pdf
1. INTRODUCTIONWe are currently living in the so-called informatio.pdf1. INTRODUCTIONWe are currently living in the so-called informatio.pdf
1. INTRODUCTIONWe are currently living in the so-called informatio.pdf
 
1. d.) Organisms using oxygenic photosynthesis release oxygen into t.pdf
1. d.) Organisms using oxygenic photosynthesis release oxygen into t.pdf1. d.) Organisms using oxygenic photosynthesis release oxygen into t.pdf
1. d.) Organisms using oxygenic photosynthesis release oxygen into t.pdf
 
1. All RTKs have a similar molecular architecture, with a ligand-bin.pdf
1. All RTKs have a similar molecular architecture, with a ligand-bin.pdf1. All RTKs have a similar molecular architecture, with a ligand-bin.pdf
1. All RTKs have a similar molecular architecture, with a ligand-bin.pdf
 
1)we can see the universe mostly in the form hydrogen and helium. .pdf
1)we can see the universe mostly in the form hydrogen and helium. .pdf1)we can see the universe mostly in the form hydrogen and helium. .pdf
1)we can see the universe mostly in the form hydrogen and helium. .pdf
 
1)D. Bacteria.2)B. Nuclear envelope3)A. Similar in function and .pdf
1)D. Bacteria.2)B. Nuclear envelope3)A. Similar in function and .pdf1)D. Bacteria.2)B. Nuclear envelope3)A. Similar in function and .pdf
1)D. Bacteria.2)B. Nuclear envelope3)A. Similar in function and .pdf
 
1) Pen R contains penicillin resistance gene .Usually + or - is not .pdf
1) Pen R contains penicillin resistance gene .Usually + or - is not .pdf1) Pen R contains penicillin resistance gene .Usually + or - is not .pdf
1) Pen R contains penicillin resistance gene .Usually + or - is not .pdf
 
0.8726Solution0.8726.pdf
0.8726Solution0.8726.pdf0.8726Solution0.8726.pdf
0.8726Solution0.8726.pdf
 
UV radiation has shorter wavelength than visible .pdf
                     UV radiation has shorter wavelength than visible .pdf                     UV radiation has shorter wavelength than visible .pdf
UV radiation has shorter wavelength than visible .pdf
 
(1) CA genetic model organism needs to have all the above features.pdf
(1) CA genetic model organism needs to have all the above features.pdf(1) CA genetic model organism needs to have all the above features.pdf
(1) CA genetic model organism needs to have all the above features.pdf
 
The relation in partSolution The relation in part.pdf
 The relation in partSolution The relation in part.pdf The relation in partSolution The relation in part.pdf
The relation in partSolution The relation in part.pdf
 
Step1 Concentration of hydroxide ion = 2x.00500=..pdf
                     Step1 Concentration of hydroxide ion = 2x.00500=..pdf                     Step1 Concentration of hydroxide ion = 2x.00500=..pdf
Step1 Concentration of hydroxide ion = 2x.00500=..pdf
 
molality = (11258.5)1 = 1.914 m Percent mass =.pdf
                     molality = (11258.5)1 = 1.914 m  Percent mass =.pdf                     molality = (11258.5)1 = 1.914 m  Percent mass =.pdf
molality = (11258.5)1 = 1.914 m Percent mass =.pdf
 
NADPH is a reducing agent that act as an electron.pdf
                     NADPH is a reducing agent that act as an electron.pdf                     NADPH is a reducing agent that act as an electron.pdf
NADPH is a reducing agent that act as an electron.pdf
 
moleculesions geometry hybridization ClF3 T-shap.pdf
                     moleculesions geometry hybridization ClF3 T-shap.pdf                     moleculesions geometry hybridization ClF3 T-shap.pdf
moleculesions geometry hybridization ClF3 T-shap.pdf
 
The major shortcoming was that the electrons were.pdf
                     The major shortcoming was that the electrons were.pdf                     The major shortcoming was that the electrons were.pdf
The major shortcoming was that the electrons were.pdf
 
The ball is an atom, the stick is a bond. You pu.pdf
                     The ball is an atom, the stick is a bond.  You pu.pdf                     The ball is an atom, the stick is a bond.  You pu.pdf
The ball is an atom, the stick is a bond. You pu.pdf
 
The anion is a good leaving group because it is p.pdf
                     The anion is a good leaving group because it is p.pdf                     The anion is a good leaving group because it is p.pdf
The anion is a good leaving group because it is p.pdf
 

Recently uploaded

Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxUnboundStockton
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
 
Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonJericReyAuditor
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 

Recently uploaded (20)

Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docx
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
 
Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lesson
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 

CODEimport java.util.; public class test { public static voi.pdf

  • 1. CODE: import java.util.*; public class test { public static void main(String args[]) { int num, sum=0; Scanner input=new Scanner(System.in); System.out.print("Input num : "); num=input.nextInt(); while(num != 13) { sum=sum+num; System.out.print("Input num : "); num=input.nextInt(); } sum=sum+num; System.out.println("Sum = "+sum); } } save the above file as test.java Output: javac test.java java test Input num : 1 Input num : 2 Input num : 3 Input num : 4 Input num : 5
  • 2. Input num : 6 Input num : 7 Input num : 8 Input num : 9 Input num : 0 Input num : 13 Sum = 58 Solution CODE: import java.util.*; public class test { public static void main(String args[]) { int num, sum=0; Scanner input=new Scanner(System.in); System.out.print("Input num : "); num=input.nextInt(); while(num != 13) { sum=sum+num; System.out.print("Input num : "); num=input.nextInt(); }
  • 3. sum=sum+num; System.out.println("Sum = "+sum); } } save the above file as test.java Output: javac test.java java test Input num : 1 Input num : 2 Input num : 3 Input num : 4 Input num : 5 Input num : 6 Input num : 7 Input num : 8 Input num : 9 Input num :