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

Being Topper

  • Home
  • About Us
  • Knowledge Base
  • Modules
    • Website Planning and Creation
    • Social Media Marketing Course
    • Search Engine Optimization
    • SEM/PPC Training
  • Branches
    • Ajmer
    • Tilak Nagar
    • Noida
    • Chandigarh
    • Mumbai
  • Contact Us

Being Topper

  • Home
  • About Us
  • Knowledge Base
  • Modules
    • Website Planning and Creation
    • Social Media Marketing Course
    • Search Engine Optimization
    • SEM/PPC Training
  • Branches
    • Ajmer
    • Tilak Nagar
    • Noida
    • Chandigarh
    • Mumbai
  • Contact Us
  • Home
  • About Us
  • Knowledge Base
  • Modules
    • Website Planning and Creation
    • Social Media Marketing Course
    • Search Engine Optimization
    • SEM/PPC Training
  • Branches
    • Ajmer
    • Tilak Nagar
    • Noida
    • Chandigarh
    • Mumbai
  • Contact Us

Being Topper

  • Home
  • About Us
  • Knowledge Base
  • Modules
    • Website Planning and Creation
    • Social Media Marketing Course
    • Search Engine Optimization
    • SEM/PPC Training
  • Branches
    • Ajmer
    • 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
640 Views
AboutBeing Topper
In Socials:
Prevjava program for checking palindrome number18/02/2014
java program to print fibonacci series18/02/2014Next

Related Posts

Information technologyYouTube

How to Apply Adsense on YouTube

I hope you are coming on this page to know about YouTube Adsense and how we can apply...

Being Topper 26/09/2017
B.tech notesBCA NOTESC++ programInformation technologyPrograms/Algorithm

Write a C program to generate Pascal’s triangle

Examples to  Pascal’s Triangle  in C Programming using control statements....

Being Topper 18/02/2014
Categories
Recent Posts
  • Vipin Khutail 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 Khutail Interacted with Top Influencers of Delhi at BJP West Delhi’s Event
  • Vipin Khutail Organized Awards & Honor Ceremony to Celebrate Social Reformers on Doctor’s Day
  • Vipin Khutail organized International Conference on Educational Excellence & Honored Visionaries

Copyright © 2021 Being Topper ® . All Rights Reserved