AD 1

Posted by : Unknown Thursday, November 20, 2014

Actually, it is a very easy program. The only difficulty that one may have is to find a logic in making that program .

Type this code in your compiler. Then Compile and Run. I have used Dev C++.

#include<stdio.h>
int main()
{
    int x,y,m,i;
    printf("Insert any two number: ");
    scanf("%d%d",&x,&y);
    if(x>y)
         m=y;
    else
         m=x;
    for(i=m;i>=1;i--)
{
         if(x%i==0&&y%i==0)
{
             printf("\nHCF of two number is : %d",i) ;
             break;
         }
    }
    return 0;
}

INPUT:-



OUTPUT:-




Leave a Reply

Subscribe to Posts | Subscribe to Comments




Total Pageviews

Popular Post

Source

Powered by Blogger.

About Us

- Copyright © Music Technology & Sports Junction -Metrominimalist- Powered by Blogger - Designed by Johanes Djogan -