Experiment 1
Student Name: JHA AMIT SUMAN UID: 20BCA1066
Branch:BCA Section/Group:3/B
Semester: 4th
Date of Performance: 16/02/2022
Subject Name: INTERNETPROGRAMMINGLAB Subject Code:20CAP-255
1. Aim/Overview of thepractical:
WriteaJavaprogramthatpromptstheuserforanintegerandthenprintsoutallprime numbers up to
thatinteger.
2. Task to bedone:
 Create a java class with suitablename.
 Enter aninteger.
 Run for loop from 2-n(n=integer).
 Check whether the no is Prime ornot.
3. Algorithm/Flowchart:
 Start ofProgram
 Take two integer n andp.
 Take n as userinput.
 Use for loops to check all the Prime number between2-n.
 If n is Prime printn.
 If n is not prime,skip.
 End of Program
4. Code forexperiment/practical:
import java.util.Scanner;
class PrimeNumbersNew
{
publicstaticvoid main(String[] args)
{
int n;
int p;
Scanner s=new Scanner(System.in);
System.out.println("Enter a number: ");
n=s.nextInt();
for(int i=2;i<n;i++)
{
p=0;
for(int j=2;j<i;j++)
{
if(i%j==0)
p=1;
}
if(p==0)
System.out.println(i);
}
}
}
5. Result/Output/WritingSummary:
Learning outcomes (What I have learnt):
1. I learned how to provide user input injava.
2. I learned about java scannerclass.
3. Learned how to conditionalStatement.
4. Learned to use the concept ofloops.
Evaluation Grid:
Sr. No. Parameters Marks Obtained Maximum Marks
1. Demonstration and Performance 5
2. Worksheet 10
3. Post Lab Quiz 5

More Related Content

DOCX
exp 1 internet programing.docx
DOC
Java final lab
PPTX
C programming assignment presentation file
DOCX
Java file
DOCX
Java file
PDF
Java programlist (1)
exp 1 internet programing.docx
Java final lab
C programming assignment presentation file
Java file
Java file
Java programlist (1)

Similar to exp unit 1 internet programing.docx (11)

PDF
Java practical N Scheme Diploma in Computer Engineering
DOCX
Cis 355 i lab 2 of 6
PPTX
Iteration- series part 1- computer ICSE.pptx
PPTX
Iteration- series ICSE computer part 1.pptx
DOCX
Important C program of Balagurusamy Book
DOCX
Cis 355 ilab 2 of 6
DOCX
Java Practice Set
DOCX
Lab manual programing
DOCX
Cis 355 ilab 2 of 6
PPT
09-ch04-1-scanner class in java with explainiation
Java practical N Scheme Diploma in Computer Engineering
Cis 355 i lab 2 of 6
Iteration- series part 1- computer ICSE.pptx
Iteration- series ICSE computer part 1.pptx
Important C program of Balagurusamy Book
Cis 355 ilab 2 of 6
Java Practice Set
Lab manual programing
Cis 355 ilab 2 of 6
09-ch04-1-scanner class in java with explainiation

More from ApkaAmitbro (8)

DOCX
Exp_3_20BCA1311 Linux Labbyharshdeep.docx
DOCX
EXP_2(20BCA1066 Internet).docx
DOCX
Exp_3_20BCA1066 Linux.docx
DOCX
Worksheet (4) linux.docx
DOCX
Template of Worksheet (4).docx
DOCX
exp_1_20bca1108(kashish_dixit.docx
DOCX
new_worksheet.docx
DOCX
exp_1_20bca1066 Internet.docx
Exp_3_20BCA1311 Linux Labbyharshdeep.docx
EXP_2(20BCA1066 Internet).docx
Exp_3_20BCA1066 Linux.docx
Worksheet (4) linux.docx
Template of Worksheet (4).docx
exp_1_20bca1108(kashish_dixit.docx
new_worksheet.docx
exp_1_20bca1066 Internet.docx

Recently uploaded (20)

PPTX
OAT_ORI_Fed Independence_August 2025.pptx
PPT
features and equilibrium under MONOPOLY 17.11.20.ppt
PPTX
PROFITS AND GAINS OF BUSINESS OR PROFESSION 2024.pptx
PDF
GVCParticipation_Automation_Climate_India
PDF
DTC TRADIND CLUB MAKE YOUR TRADING BETTER
PPTX
2. RBI.pptx202029291023i38039013i92292992
PPT
CompanionAsset_9780128146378_Chapter04.ppt
PDF
The Right Social Media Strategy Can Transform Your Business
PPTX
Grp C.ppt presentation.pptx for Economics
PPTX
General-Characteristics-of-Microorganisms.pptx
PDF
THE EFFECT OF FOREIGN AID ON ECONOMIC GROWTH IN ETHIOPIA
PDF
How to join illuminati agent in Uganda Kampala call 0782561496/0756664682
PDF
3CMT J.AFABLE Flexible-Learning ENTREPRENEURIAL MANAGEMENT.pdf
PDF
Lundin Gold Corporate Presentation August 2025
PDF
HCWM AND HAI FOR BHCM STUDENTS(1).Pdf and ptts
PPTX
ML Credit Scoring of Thin-File Borrowers
PPTX
Module5_Session1 (mlzrkfbbbbbbbbbbbz1).pptx
PPTX
PPT-Lesson-2-Recognize-a-Potential-Market-2-3.pptx
PDF
Pitch Deck.pdf .pdf all about finance in
PDF
01 KEY PROVISIONS on NGPA and PROFESSIONALIZATION.pdf
OAT_ORI_Fed Independence_August 2025.pptx
features and equilibrium under MONOPOLY 17.11.20.ppt
PROFITS AND GAINS OF BUSINESS OR PROFESSION 2024.pptx
GVCParticipation_Automation_Climate_India
DTC TRADIND CLUB MAKE YOUR TRADING BETTER
2. RBI.pptx202029291023i38039013i92292992
CompanionAsset_9780128146378_Chapter04.ppt
The Right Social Media Strategy Can Transform Your Business
Grp C.ppt presentation.pptx for Economics
General-Characteristics-of-Microorganisms.pptx
THE EFFECT OF FOREIGN AID ON ECONOMIC GROWTH IN ETHIOPIA
How to join illuminati agent in Uganda Kampala call 0782561496/0756664682
3CMT J.AFABLE Flexible-Learning ENTREPRENEURIAL MANAGEMENT.pdf
Lundin Gold Corporate Presentation August 2025
HCWM AND HAI FOR BHCM STUDENTS(1).Pdf and ptts
ML Credit Scoring of Thin-File Borrowers
Module5_Session1 (mlzrkfbbbbbbbbbbbz1).pptx
PPT-Lesson-2-Recognize-a-Potential-Market-2-3.pptx
Pitch Deck.pdf .pdf all about finance in
01 KEY PROVISIONS on NGPA and PROFESSIONALIZATION.pdf

exp unit 1 internet programing.docx

  • 1. Experiment 1 Student Name: JHA AMIT SUMAN UID: 20BCA1066 Branch:BCA Section/Group:3/B Semester: 4th Date of Performance: 16/02/2022 Subject Name: INTERNETPROGRAMMINGLAB Subject Code:20CAP-255 1. Aim/Overview of thepractical: WriteaJavaprogramthatpromptstheuserforanintegerandthenprintsoutallprime numbers up to thatinteger. 2. Task to bedone:  Create a java class with suitablename.  Enter aninteger.  Run for loop from 2-n(n=integer).  Check whether the no is Prime ornot. 3. Algorithm/Flowchart:  Start ofProgram  Take two integer n andp.  Take n as userinput.  Use for loops to check all the Prime number between2-n.  If n is Prime printn.  If n is not prime,skip.  End of Program
  • 2. 4. Code forexperiment/practical: import java.util.Scanner; class PrimeNumbersNew { publicstaticvoid main(String[] args) { int n; int p; Scanner s=new Scanner(System.in); System.out.println("Enter a number: "); n=s.nextInt(); for(int i=2;i<n;i++) { p=0; for(int j=2;j<i;j++) { if(i%j==0) p=1; } if(p==0) System.out.println(i); } } } 5. Result/Output/WritingSummary:
  • 3. Learning outcomes (What I have learnt): 1. I learned how to provide user input injava. 2. I learned about java scannerclass. 3. Learned how to conditionalStatement. 4. Learned to use the concept ofloops. Evaluation Grid: Sr. No. Parameters Marks Obtained Maximum Marks 1. Demonstration and Performance 5 2. Worksheet 10 3. Post Lab Quiz 5