answersLogoWhite

0

Codings for coprime number in c?

Updated: 12/12/2022
User Avatar

Wiki User

10y ago

Best Answer

#include<stdio.h>

int main(){

int n1,n2;

printf("\nEnter two numbers:");

scanf("%d %d",&n1,&n2);

while(n1!=n2){

if(n1>=n2)

n1=n1-n2;

else

n2=n2-n1;

}

printf("\nGCD=%d",n1);

return 0;

}

User Avatar

Wiki User

10y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Codings for coprime number in c?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Where you get c codings?

u can get it on helpucode.blogspot.in daniweb.com


C plus plus codings for bank management?

yes


What is a number that is coprime with 100?

3


What number coprime with 18?

coprime numbers with 18 are : 17 and 19.


Fill in the syllogism. If ab and bc then a?

The answer will depend on whether or not the relationship between the pairs of variables is transitive. In mathematics, not all relationships are transitive.For example, if the relationship is "is coprime with", then2 is coprime with 3, 3 is coprime with 4 but 2 is certainly not coprime with 4.


What is the LCM of ab and bc?

It depends on whether or not a and c are coprime (have no factors in common). Suppose x is the greatest common factor of a and c, where x = 1 if a and c are coprime. ie GCF(a, c) = x then let a = x*m and c = x*n where m and n are coprime then LCM(ab, bc) = LCM(x*m*b, x*n*b) = x*m*n*b


Is 5 and 7 coprime?

Coprime numbers are those in which only 1 and that number (say 5) can be divisible by it. Both 5 and 7 would be coprime numbers because they are numbers divisible by only themselves and 1.


What is a co-prime number?

There is no such thing as a coprime number.Two integers are said to be relatively prime (or coprime) if they have no common positive factor, other than 1. Examples:Any two different prime numbers are coprime.16 and 27 are coprime.14 and 18 are not coprime. They have the common factor 2.


Are 6 and 8 are coprime number?

No. They are both multiples of 2.


HCF of two coprime number is?

The product of the two numbers


Is the 5 and 12 are coprime numbers?

No 5 is a prime number and 12 is composite number


What number goes into both 242 and 63?

1, the numbers are coprime