• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Question About Nested Loops

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I was told to write a small program that finds the floor of logb(X). I took the main functionality of the program to create what I pasted below. In the program I have below, the base and x-value are already there - it's just for the concept.

I was told to use nested loops. However, I feel that the way I did it is fine. Would it be better if I used a nested loop? I'm not sure I would know exactly how to go about doing it, thought I'm sure there are a lot of ways to do it.

Thanks.

 
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If your assignment was to write a program that finds the floor of logb(X), then the method you use is up to you.
If your assignment was to write a program that uses nested loops, then you need to use nested loops.
You need to ask whoever gave you the assignment whether what you have done is okay.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic