- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Euler’s criterion in java
According to Euler’s criterion a square root of n under modulo p exists if and only if a number num exists such that num%p is equal to n%p.
Program
import java.util.Scanner; public class EulersCriterion { public static void main(String args[]) { Scanner sc = new Scanner(System.in); System.out.println("Enter n value :"); int n = sc.nextInt(); System.out.println("Enter p value :"); int p = sc.nextInt(); n = n % p; int flag = 0; for (int num = 2; num < p; num++) { if ((num * num) % p == n) { flag = 1; } } if(flag==1) { System.out.println("root of a number under modulo p exists "); } else { System.out.println("root of a number under modulo p does not exists "); } } }
Output
Enter n value : 2 Enter p value : 7 root of a number under modulo p exists
- Related Articles
- What is Euler’s Theorem in Information Security?
- Euler’s Totient function for all numbers smaller than or equal to n in java
- Signals and Systems: BIBO Stability Criterion
- Mean-Variance criterion for defining efficient and inefficient assets
- What is the Kelly Criterion and how does it work?
- Signals and Systems – Causality and Paley-Wiener Criterion for Physical Realization
- How to subset rows based on criterion of multiple numerical columns in R data frame?
- How can we use the RHS theorem or criterion for the congruence of triangles?
- What is the criterion for classification of organisms as belonging to kingdom Monera or Protista?
- You want to show that $∆ART ≅ ∆PEN$,$(a)$ If you have to use SSS criterion
- If ∆ABC and ∆PQR are to be congruent, name one additional pair of corresponding parts. What criterion did you use?"
- State which pairs of triangles in the given figures are similar. Write the similarity criterion used by you for answering the question and also write the pairs of similar triangles in the symbolic form:"
- Which congruence criterion do you use in the following?$(a)$. Given: $AC = DF$$AB = DE$$BC = EF$So, $∆ABC ≅ ∆DEF$$(b)$ Given: $ZX = RP$$RQ = ZY$$angle PRQ = angle XZY$So
- Diagonals $AC$ and $BD$ of a trapezium $ABCD$ with $AB | DC$ intersect each other at the point $O$. Using a similarity criterion for two triangles, show that $frac{OA}{OC}=frac{OB}{OD}$∙
- Java Stream Collectors toCollection() in Java

Advertisements