Program to print unique pairs of numbers such that multiplication of the pair is given number

//Program to print unique pairs of numbers such that multiplication
//of the pair is given number
#include<stdio.h>
#include<conio.h>
int main()
{
 int n,k=1,j;
 clrscr();
 printf("Enter the number\n");
 scanf("%d",&n);
 while(k<n)
 {
 if(n%k==0)
 {
 if(k<n/k)
 printf("%d * %d = %d\n",k,n/k,n);
 }
   k++;
 }

  getch();
  return 0;
}

To Run this Program Copy it in text editor and save as .c
Then double click on it and then it will get opened in your compiler.
Click on run.

No comments:

Post a Comment