beingtopper.jkp@gmail.com
+91-7529019575
Free Demo

Being Topper

  • Home
  • About Us
    • Founder’s Profile
    • Franchise
    • Women’s Entrepreneurship Development
  • Blog & Events
  • Modules
    • Website Planning and Creation
    • Social Media Marketing Course
    • Search Engine Optimization
    • SEM/PPC Training
  • Branches
    • Rajasthan
      • Ajmer
      • Jaipur
      • Jodhpur
      • Udaipur
      • Kota
      • Sikar
    • Janakpuri
    • Tilak Nagar
    • Noida
    • Chandigarh
    • Mumbai
  • Contact Us

Being Topper

  • Home
  • About Us
    • Founder’s Profile
    • Franchise
    • Women’s Entrepreneurship Development
  • Blog & Events
  • Modules
    • Website Planning and Creation
    • Social Media Marketing Course
    • Search Engine Optimization
    • SEM/PPC Training
  • Branches
    • Rajasthan
      • Ajmer
      • Jaipur
      • Jodhpur
      • Udaipur
      • Kota
      • Sikar
    • Janakpuri
    • Tilak Nagar
    • Noida
    • Chandigarh
    • Mumbai
  • Contact Us
  • Home
  • About Us
    • Founder’s Profile
    • Franchise
    • Women’s Entrepreneurship Development
  • Blog & Events
  • Modules
    • Website Planning and Creation
    • Social Media Marketing Course
    • Search Engine Optimization
    • SEM/PPC Training
  • Branches
    • Rajasthan
      • Ajmer
      • Jaipur
      • Jodhpur
      • Udaipur
      • Kota
      • Sikar
    • Janakpuri
    • Tilak Nagar
    • Noida
    • Chandigarh
    • Mumbai
  • Contact Us

Being Topper

  • Home
  • About Us
    • Founder’s Profile
    • Franchise
    • Women’s Entrepreneurship Development
  • Blog & Events
  • Modules
    • Website Planning and Creation
    • Social Media Marketing Course
    • Search Engine Optimization
    • SEM/PPC Training
  • Branches
    • Rajasthan
      • Ajmer
      • Jaipur
      • Jodhpur
      • Udaipur
      • Kota
      • Sikar
    • Janakpuri
    • Tilak Nagar
    • Noida
    • Chandigarh
    • Mumbai
  • Contact Us
B.tech notesBasic ProgramsBCA NOTESInformation technologyJava Programs

java program for checking prime number

Being Topper 18/02/2014 0 Comments

checking prime number

import java.util.Scanner ;
class CheckPrime
{
public static void main ( String s[] )
{
System.out.println ( " Enter a number: ");

Scanner value = new Scanner ( System.in );
int number = value.nextInt ( );
int flag =0;
int c = (int) Math.sqrt( number );

 

 

 
for ( int i = 2 ; i <=c ; i++ )
{
if ( (number % i ) == 0 )
{

System.out.println ( " the number" + number + " is not a prime number ");

flag =1 ; break ; }

}

if (flag == 0 )

System.out.println ( " the number is a prime number" );
}
}
java program for checking prime number
995 Views
AboutBeing Topper
In Socials:
Prevjava program for checking palindrome number18/02/2014
java program to print fibonacci series18/02/2014Next

Related Posts

BCA NOTES

WAP to demonstrate Polymorphism in Vb.net through Method Overloading

 Demonstratation of  Polymorphism in Vb.net through Method Overloading : code begins...

Being Topper 17/10/2014
BCA NOTES

Program in VB.Net to build a class which implements an interface

Que : Write a program in VB.Net to build a class which implements an interface Ans:...

Being Topper 17/10/2014
Categories
Recent Posts
  • Vipin Khuttel Inspires Entrepreneurs at Networking Meet in Gurgaon
  • Vipin Khuttel Founder of Being Topper Recognized for Advancing Digital Literacy and Social Empowerment
  • Vipin Khuttel Organizes International Conference for Digital Excellence 2, Elevating the Future of Technology
  • India’s Top Occult Science Enthusiasts Gather at AgyatOnSearch – Awards & Seminar in New Delhi
  • India’s Leading Digital Marketer, Vipin Khuttel Interacted with Top Influencers of Delhi at BJP West Delhi’s Event

Copyright © 2025 Being Topper ® . All Rights Reserved