• 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

help me correct my program

 
Ranch Hand
Posts: 94
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i am trying to get a program which prints true or false....to find out the given number is prime number and Fibonacci series.. below is my code which is not giving the output as expecting

 
Ranch Hand
Posts: 47
MyEclipse IDE Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
....use the code tag please
and please tell us what is the output you are getting..
 
kiran kumar reddy
Ranch Hand
Posts: 94
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ankit Dan wrote: ....use the code tag please
and please tell us what is the output you are getting..


out put is depending on input we are giving. for every prime number and Fibonacci number it is saying true and some times "true" will be printed more than once.
and when it is not either prime or Fibonacci number it is not showing anything. i got Fibonacci and prime number programs separately and were running successfully but combining them and getting out put is making me stuck.
 
Ranch Hand
Posts: 300
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

You can put this function check whether it is among the series or not...



Modify code according your need. and prime number is very easy you can get reference from any where.

Regards
Jatan
 
reply
    Bookmark Topic Watch Topic
  • New Topic