# Thread: someone can help me to find where is the mistake

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");

2. ## 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.

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

4. ## 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
Good, you saw it. And no, I am Jewish.

Bettawfeeq

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

6. ## Re: someone can help me to find where is the mistake

what is wrong
You tell us the symptoms of what is wrong; we are not going to debug badly indented, badly formatted code for you.

Jos

ps I find your screen name rather stupid.

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

8. ## 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
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.

Jos

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

10. ## 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
Many, many bad things have been done in the name of (a) jihad (especially against non-muslim societies) so the name has (at least to me) a very bad connotation.

Jos

ps. discussion closed

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

12. ## Re: someone can help me to find where is the mistake

I think that we know this. No one has a monopoly on terrorism or doing harm or good in the name of their religion.

But we're getting away from discussions of Java by just a bit.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•