Results 1 to 12 of 12
- 10-22-2011, 01:39 PM #1
Member
- Join Date
- Oct 2011
- Posts
- 24
- Rep Power
- 0
someone can help me to find where is the mistake
when I enter value it gave always is not perfect number
static void perfectn()
{int a;
Scanner cso=new Scanner(System.in);
a=cso.nextInt();
int z,x,y;x=0;
for(z=1;z<=a;z++)
{
if(a%z==0){x=x+z;}
}
if(a==x){System.out.println(a+" is perfect number");}
else System.out.println(a+" is not perfect number");
-
Re: someone can help me to find where is the mistake
Print out the value of x at the end of your method and see if it makes sense by comparing it with what you calculate on paper it should be. With this number you should be able to figure out your bug. Another hint: look at your for loop control statement (the first line that begins for (... ) because that's where your bug is.
um, nice forum name by the way. I think.Last edited by Fubarable; 10-22-2011 at 01:56 PM.
- 10-22-2011, 02:49 PM #3
Member
- Join Date
- Oct 2011
- Posts
- 24
- Rep Power
- 0
Re: someone can help me to find where is the mistake
thanks alot there is an = and it doesnt work correctly programming is laughable
are you muslim
-
Re: someone can help me to find where is the mistake
- 10-22-2011, 03:20 PM #5
Member
- Join Date
- Oct 2011
- Posts
- 24
- Rep Power
- 0
Re: someone can help me to find where is the mistake
hmm
I have another question
I should write a program that should print leap year in 21.century (2001 to 2102)
these are codes
public class P32 {
public static void main(String[] args)
{ int a,b,c;
for(a=2001;a<2103;++a)
{ if((a%4==0)&&(a%100!=0)||(a%400==0))
System.out.println(a+" ");
}
}
}
what is wrong
- 10-22-2011, 03:35 PM #6
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,375
- Blog Entries
- 7
- Rep Power
- 17
Re: someone can help me to find where is the mistake
When people rob a bank they get a penalty; when banks rob people they get a bonus.
- 10-22-2011, 04:01 PM #7
Member
- Join Date
- Oct 2011
- Posts
- 24
- Rep Power
- 0
Re: someone can help me to find where is the mistake
actually it is my real name
it is not stupid it has very deep meaning
I cant explain but basicly it means to fight for Allah who create you
but every person has different mind it can be stupid for you
by the way you are so tough if you dont want to help you dont write
why you are acting like that
- 10-22-2011, 04:06 PM #8
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,375
- Blog Entries
- 7
- Rep Power
- 17
Re: someone can help me to find where is the mistake
Everyone is free to write here; you can't forbid anyone to do so; I can't forbid you to write here and I don't even attempt to do so. The 'deep' meaning of you name is in the eye of the beholder; it isn't 'deep' for me (I don't believe in any god at all b.t.w.) and I find it insulting; it isn't your fault if it is your real name.
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 10-22-2011, 04:19 PM #9
Member
- Join Date
- Oct 2011
- Posts
- 24
- Rep Power
- 0
Re: someone can help me to find where is the mistake
if you dont believe god I cant explain the perfect side of the name because I dont have enough information it is very religious word .there are maybe millions of book which try to explain meanning of jihad but if you search islam you will see what is jihad and why people are doing jihad
if you add me on facebook or msn I will try to explain more thing about doing jihad
- 10-22-2011, 04:32 PM #10
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,375
- Blog Entries
- 7
- Rep Power
- 17
Re: someone can help me to find where is the mistake
When people rob a bank they get a penalty; when banks rob people they get a bonus.
- 10-22-2011, 10:12 PM #11
Member
- Join Date
- Oct 2011
- Posts
- 24
- Rep Power
- 0
Re: someone can help me to find where is the mistake
these things are imposed by western media but you dont know what these muslim people try to do they just want to live their land in peace but these topic very dangerous to discuss in local channel .
I Just want to say Muslims are not terrorist if you have a chance to met a good muslim you will change your idea I am a muslim and I am not a terorist I hoop you will met with a good muslim also there are millions of good muslims
-
Similar Threads
-
Hello, I got a mistake
By F1ke in forum New To JavaReplies: 7Last Post: 09-25-2011, 08:11 PM -
Help me ! identifying the mistake
By o0oNorao0o in forum New To JavaReplies: 6Last Post: 11-06-2010, 10:03 PM -
i can't see the mistake
By PVL268 in forum New To JavaReplies: 3Last Post: 04-29-2009, 05:26 AM -
i can't see the mistake
By PVL268 in forum New To JavaReplies: 2Last Post: 04-28-2009, 06:30 AM -
PLEASE!!!help me to find mistake
By sasha20 in forum New To JavaReplies: 1Last Post: 01-11-2008, 10:50 AM


LinkBack URL
About LinkBacks


Bookmarks