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
*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",