[tech4all] debug it.....
hi 2 all
here is a simple program in c .find the error in this program.
this is a program 2 find lcm for 2 nos.the concept i have used is
lcm = product of 2 nos./gcd
#include<stdio.h>
#include<conio.h>
main()
{
long int a,b,x,y;
printf("enter 2 nos\n");
scanf("%d %d",&a,&b);
x=a;
y=b;
while(a!=b)
{
if(a>b)
a=a-b;
else
b=b-a;
}
lcm=(x*y)/a;
printf("the lcm is%d",lcm);
}
in this prog. if i give small values i get the result.if i give the values like 200 & 250 im not getting the result.why is it so?
please debug the error here.
bye
BHARATH..
Yahoo! Groups Links
- To visit your group on the web, go to:
http://groups.yahoo.com/group/tech4all/
- To unsubscribe from this group, send an email to:
tech4all-unsubscribe@yahoogroups.com
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

0 Comments:
Post a Comment
<< Home