Re: [algogeeks] Let's see if U can find the bug...

2011-08-30 Thread Sanjay Rajpal
This program is working fine. No bugs. Sanju :) On Mon, Aug 29, 2011 at 11:06 PM, Mohit Gupta wrote: > *1.* > /* Print armstrong numbers from 1 to 500 */ > /*1st version of prgrm: I am using pow function*/ > #include > #include > #include > int main() > { > int num=1,temp,sum,r; > while(num<=5

[algogeeks] Let's see if U can find the bug...

2011-08-29 Thread Mohit Gupta
*1.* /* Print armstrong numbers from 1 to 500 */ /*1st version of prgrm: I am using pow function*/ #include #include #include int main() { int num=1,temp,sum,r; while(num<=500){ sum=0; temp=num; while(temp){ r=temp%10; sum+=pow(r,3); temp/=10; } if(sum==num) printf("%d\n",