User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C section within the Software Development category of DaniWeb, a massive community of 456,562 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,507 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C advertiser: Programming Forums
Views: 1914 | Replies: 6
Reply
Join Date: Sep 2007
Location: INDIA
Posts: 3
Reputation: vinaychalluru is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
vinaychalluru's Avatar
vinaychalluru vinaychalluru is offline Offline
Newbie Poster

Question armstrong number

  #1  
Oct 24th, 2007
Hi,every one I am going to find whether the given number is a armstrong number or not and I have done my level best and I need your help in one thing,If any mistakes,please reply and I need your other views to develop my C skills.hope help from you all

thank you
vinaychalluru
Attached Files
File Type: txt [1].txt (679 Bytes, 11 views)
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Aug 2005
Location: near St Louis, Missouri, USA
Posts: 11,541
Reputation: Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of 
Rep Power: 40
Solved Threads: 972
Moderator
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Most Valuable Poster

Re: armstrong number

  #2  
Oct 24th, 2007
google will give you a lot of help, such as this one.
<<Freelance Programmer>> << Hobby Site>>
Signature links for sale. PM me for details
Reply With Quote  
Join Date: Nov 2007
Posts: 8
Reputation: tech2chill is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
tech2chill tech2chill is offline Offline
Newbie Poster

Re: armstrong number

  #3  
Nov 5th, 2007
hope this helps u gettin final code...
eg:..to find 3 digit armstrong number:

void main()
{
int a,b,c,i;

printf("enter a 3 digit number\n");
scanf("%d",&i);

a=(i-(i%100))/100;
b=((i%100)-(i%10))/10;
c=i%10;
num=(a*a*a)+(b*b*b)+(c*c*c);
if(num==i)
printf("\nthis is armstrong");
getch();
}
Reply With Quote  
Join Date: Nov 2007
Posts: 1
Reputation: vandanagilani is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
vandanagilani vandanagilani is offline Offline
Newbie Poster

Re: armstrong number

  #4  
Nov 8th, 2007
Hi,
I have a soln for solving armstrong numbers
  1. #include<stdio.h>
  2. #include<conio.h>
  3. void main()
  4. {
  5. int i,j,n,r,c,k;
  6. clrscr();
  7. printf("Armstrong numbers\n");
  8. for(i=1;i<=500;i++)
  9. {
  10. c=0;
  11. n=i;
  12. k=n;
  13. while(n!=0)
  14. {
  15. r=n%10;
  16. c=c+(r*r*r);
  17. n=n/10;
  18. }
  19. if(c==k)
  20. printf("%d\n",k);
  21. }
  22. getch();
  23. }
Last edited by stymiee : Nov 8th, 2007 at 11:16 am. Reason: please use code tags
Reply With Quote  
Join Date: Sep 2004
Posts: 6,515
Reputation: Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of 
Rep Power: 31
Solved Threads: 489
Super Moderator
Narue's Avatar
Narue Narue is offline Offline
Expert Meanie

Re: armstrong number

  #5  
Nov 8th, 2007
>hope this helps u gettin final code...
>I have a soln for solving armstrong numbers
I take solace in the fact that people who give away homework solutions usually come from the shallow end of the programmer pool.
I'm here to prove you wrong.
Reply With Quote  
Join Date: Aug 2007
Posts: 1
Reputation: nitishssingh is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
nitishssingh's Avatar
nitishssingh nitishssingh is offline Offline
Newbie Poster

Re: armstrong number

  #6  
Nov 8th, 2007
hii narue
Reply With Quote  
Join Date: Sep 2004
Posts: 6,515
Reputation: Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of 
Rep Power: 31
Solved Threads: 489
Super Moderator
Narue's Avatar
Narue Narue is offline Offline
Expert Meanie

Re: armstrong number

  #7  
Nov 9th, 2007
Hi nitishssingh. I read the PM you sent me, and no, I won't help you cheat your way through school.
I'm here to prove you wrong.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb C Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the C Forum

All times are GMT -4. The time now is 5:42 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC