Sunday, 21 January 2018

Program for GCD


Program for GCD
#include<stdio.h>
#include<conio.h>
main()
{
int m,n,r;
clrscr();
printf("enter the m,n value");
scanf("%d%d",&m,&n);
while(n!=0)
{
r=m%n;
m=n;
n=r;
}
printf("GCD of given no Is%d",m);
getch();
}

Related Posts:

  • Program for Diamond#include<stdio.h>#include<conio.h>main(){ int n,i,j,k,nol; clrscr(); printf("Enter the value:"); scanf("%d",&nol); for(n=1;n<=nol;n++) { for(i=1;i<=40-n;i++) printf("   "); for(j=1;j<=n;j… Read More
  • Program for Graphic #include<stdio.h>#include<conio.h>main(){ char str[30]="**ANIL KUMAR**"; int i,j; clrscr(); gotoxy(35,1); printf("%s",str); { for(i=0;str[i]!='\0';++i) { for(j=1;j<=23;++j) { textcolor(j+i); gotoxy(35+i,j+i); s… Read More
  • Program for Heart Symbol#include<stdio.h>#include<conio.h>main(){ int i,j; clrscr(); gotoxy(33,9); printf("  %c%c%c       %c%c%c\n",3,3,3,3,3,3); gotoxy(32,10); printf(" %c     %c   %c&nb… Read More
  • Add of Two Numbers#include<stdio.h>#include<conio.h>main (void){ int a,b,c; clrscr(); printf("enter the value:"); scanf("%d %d",&a,&b); c=a+b; printf("the result is %d",c); getch();}�… Read More
  • Program for GCD#include<stdio.h>#include<conio.h>main(){ int m,n,r; clrscr(); printf("enter the m,n value"); scanf("%d%d",&m,&n); while(n!=0) { r=m%n; m=n; n=r; } printf("GCD of given no Is%d",m); getch();}�… Read More

0 comments:

Post a Comment