Skip to content

AniketIXR/Hello-World

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Hello-World

This is my 1st Repository

Hello there.Its my 1st time in github.

one of my code in java

import java.util.*; class Primepalin { void accept() { Scanner sc=new Scanner(System.in); System.out.println("Enter a no.="); int n=sc.nextInt(); display(n); } void display(int n) { int pr=Check_Prime(n); boolean pa=Check_Palindrome(n); if(pr == 1 && pa == true) System.out.println("The no is primepalin no."); else System.out.println("The no. is not a Primepalin no,"); } int Check_Prime(int n) { int c=0; for(int i=2;i<=n/2;i++) { if(n%i==0) { c++; break; } } if(c==0) return 1; else return 0;

}
boolean Check_Palindrome(int n)
{
    int m=n,r=0;
    while(m!=0)
    {
        r=r*10+(m%10);
        m/=10;
    }
    if(n==r)
    return true;
    else
    return false;
}
public static void main()
{
   Primepalin obj=new Primepalin();
   obj.accept();
}

}

About

This is my 1st Repository

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published