ايجاد العدد الاولي بلغة الجافا


ايجاد العدد الاولي بلغة الجافا




package test_prime;
import java.util.*;

public class Test_prime {

    public static void main(String[] args) {
        // TODO code application logic here
        
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        
        int n = x%2;
        if(n != 0)
            System.out.println("the number is prime");
        else
            System.out.println("the number is not prime");
        
    }
    
}

شاهد الفيديو هنا 

ليست هناك تعليقات:

يتم التشغيل بواسطة Blogger.