tag:blogger.com,1999:blog-5531960551406702359.post6770323384737472567..comments2024-03-29T12:14:02.680+05:30Comments on C Programming | Computer | Ms-Excel: GCD or HCF of two numbersDinesh Berahttp://www.blogger.com/profile/17779626530091691900noreply@blogger.comBlogger14125tag:blogger.com,1999:blog-5531960551406702359.post-22254398307155961322014-10-09T21:07:15.315+05:302014-10-09T21:07:15.315+05:30@Swathi,
We can omit the if condition.
The if con...@Swathi,<br /><br />We can omit the if condition.<br />The if condition ensure that first number (n1) should be always be bigger to second number.<br />In this program if condition used because user can understand what is happening during the compiling.<br /><br />If you omit the "if condition" , it happens in do...while loop.Dinesh Berahttps://www.blogger.com/profile/17779626530091691900noreply@blogger.comtag:blogger.com,1999:blog-5531960551406702359.post-62185848686700118222014-10-09T19:52:36.246+05:302014-10-09T19:52:36.246+05:30n1 65 n2 45 then how the condition satisfie n2>...n1 65 n2 45 then how the condition satisfie n2>n1 tell me fast <br />Anonymoushttps://www.blogger.com/profile/13145823076783349601noreply@blogger.comtag:blogger.com,1999:blog-5531960551406702359.post-5613685319865630712014-10-09T19:49:26.841+05:302014-10-09T19:49:26.841+05:30n1>n2 then wat is the answern1>n2 then wat is the answer<br />Anonymoushttps://www.blogger.com/profile/13145823076783349601noreply@blogger.comtag:blogger.com,1999:blog-5531960551406702359.post-38003409324839041622014-10-09T19:40:05.480+05:302014-10-09T19:40:05.480+05:30@Swathi Kankata,
We can set the condition accordi...@Swathi Kankata,<br /><br />We can set the condition according to required program and responsive result.<br /><br />If you change the condition in above "finding the GCD or HCF" program n1>n2 rather than n2>n1<br /><br />Then you should make this algorithm, set all related condition, cross check with putting the dummy data and run the program.<br /><br />Hope its helpful. Dinesh Berahttps://www.blogger.com/profile/17779626530091691900noreply@blogger.comtag:blogger.com,1999:blog-5531960551406702359.post-13871292876377937982014-10-09T19:21:08.609+05:302014-10-09T19:21:08.609+05:30n1>n2 meansn1>n2 meansAnonymoushttps://www.blogger.com/profile/13145823076783349601noreply@blogger.comtag:blogger.com,1999:blog-5531960551406702359.post-6154233469208391182013-12-03T21:36:34.871+05:302013-12-03T21:36:34.871+05:30cant we write this program with while loop?
cant we write this program with while loop?<br />Anonymoushttps://www.blogger.com/profile/03504519345090724828noreply@blogger.comtag:blogger.com,1999:blog-5531960551406702359.post-50372450484849469992013-04-21T10:31:12.912+05:302013-04-21T10:31:12.912+05:30That means swapping(interchange) the values for ex...That means swapping(interchange) the values for example<br />n1=45<br />n2=65<br /> <br /> condition is n2>n1<br /> n1=n1+n2 -> n1=45+65=110 // now n1=110<br /> n2=n1-n2 -> n2=110-65=45 // now n2=45<br /> n1=n1-n2 -> n1=110-45=65 // now n1=65<br /><br />finally n1=65 , n2=45sreenivasulu anthatihttps://www.blogger.com/profile/04348002581936472143noreply@blogger.comtag:blogger.com,1999:blog-5531960551406702359.post-1937661080545165552012-12-27T23:56:14.071+05:302012-12-27T23:56:14.071+05:30@Khaoula Ali,
"rem" is a variable that ...@Khaoula Ali,<br /><br />"rem" is a variable that represent the reminder.<br />For example:<br />rem = 14%5 = 4Dinesh Berahttps://www.blogger.com/profile/17779626530091691900noreply@blogger.comtag:blogger.com,1999:blog-5531960551406702359.post-75087303713198127322012-12-27T23:54:07.333+05:302012-12-27T23:54:07.333+05:30@Khaoula Ali,
It is swapping of number if second n...@Khaoula Ali,<br />It is swapping of number if second number is greater then first number.<br />For example:<br />num1 = 5<br />num2 = 10<br /><br />As our condition: num2 > num1 is True so,<br /><br />n1=n1+n2 = 5+10 = 15 ; //now n1 value = 15<br />n2=n1-n2 = 15-10 = 5 ; //now n2 value = 5<br />n1=n1-n2 = 15-5 = 10 ; //now n1 value = 10<br /><br />So you can see that n1 and n2 value has been swap.Dinesh Berahttps://www.blogger.com/profile/17779626530091691900noreply@blogger.comtag:blogger.com,1999:blog-5531960551406702359.post-30323569222177506692012-12-27T23:32:50.165+05:302012-12-27T23:32:50.165+05:30and wht is rem ? and wht is rem ? Anonymoushttps://www.blogger.com/profile/10771188286353317475noreply@blogger.comtag:blogger.com,1999:blog-5531960551406702359.post-29746910957442648442012-12-27T23:31:42.090+05:302012-12-27T23:31:42.090+05:30please I want to understand wht does this mean
n1...please I want to understand wht does this mean <br />n1=n1+n2;<br /> n2=n1-n2;<br /> n1=n1-n2;Anonymoushttps://www.blogger.com/profile/10771188286353317475noreply@blogger.comtag:blogger.com,1999:blog-5531960551406702359.post-11135174809267639102012-12-05T05:52:44.546+05:302012-12-05T05:52:44.546+05:30thnks
thnks<br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5531960551406702359.post-20727168176972545882012-08-25T23:28:11.139+05:302012-08-25T23:28:11.139+05:30good program...
good program...<br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5531960551406702359.post-59900017983989136132011-09-15T15:23:15.187+05:302011-09-15T15:23:15.187+05:30wow great! its help me thanxwow great! its help me thanxAnonymousnoreply@blogger.com