Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Prime or Not
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
import java.io.*; import java.util.Scanner; class Rextester { public static void main(String[] args)throws IOException { Scanner sc =new Scanner(System.in); System.out.println("Enter a Number"); int n= sc.nextInt(); int s=0; for (int i=1;i<=n;i++) { if (n%i==0) { s++; } } if (s==2) {System.out.println("Prime number it is "+n); } else {System.out.println("Prime number it is not "+n); } } }
7
[
-
]
Show input
Compilation time: 0.62 sec, absolute running time: 0.16 sec, cpu time: 0.17 sec, memory peak: 20 Mb, absolute service time: 0,79 sec
edit mode
|
history
|
discussion