Please check our Instructions to Authors and send your manuscripts to nifs.journal@gmail.com. Next issue: September/October 2024.
Deadline for submissions: 16 November 2024.
User talk:Vassia Atanassova
Jump to navigation
Jump to search
#include<stdio.h>
int main()
{
int n, i, j, a, b, minMultiple, lcm, r;
printf("enter n value:");
scanf("%d", &n);
printf("Classical Pairs:");
for(i=2; i<n; i++)
{
for(j=i+1; j<n; j++)
{
a = i;
b = j;
// maximum number between a and b is stored in minMultiple
minMultiple = (a>b) ? a : b;
// Always true
while(1)
{
if (minMultiple%a==0 && minMultiple%b==0)
{
//lCM of the two numbers will be stored in minmultiple
lcm = minMultiple;
r = (lcm%n);
if( r == 0 )
{
printf("{%d,%d},",a,b);
}
break;
}
++minMultiple;
}
}
}
return 0;
}