Latest Tutorials| Questions and Answers|Ask Questions?|Site Map




Have Programming Question? Ask it here!
 
 
 


mangboi
Plz give the answers
1 Answer(s)      5 years and 8 months ago
Posted in : Java Interview Questions



Advertisement
View Answers

January 19, 2009 at 1:34 AM


Hi friend,

Code to help in solving the problem :

public class PerfectNumber {
public static void main(String args[])
{
int a=5,b=0,c=0,d=0;
System.out.println("Enter a Number");

d=a;
for (int i=1;i<=a-1;i++)
{
b=a%i; // im not sure if its b= n%i or b=i%n i cant remember which is the right one
if(b==0)
{
c=c+i;
}
}
if(d==a)
System.out.println("Entered Number is perfect number");
else
System.out.println("Entered Number is not perfect");
}
}

For read more information,Examples and tutorials on java visit to :

http://www.roseindia.net/java/


Thanks


Related Tutorials/Questions & Answers:
Plz give the answers - Java Interview Questions
Plz give the answers  1.Computing cos(x) using the cosine series: Recall that cos(x) is given by the following series: Write a program to compute cosine of a number x using the above series. Ignore terms less than 0.00001.
plz give me answer plz
plz give me answer plz  writw a programme to find rank from an array using doubledimmensionalarray
Advertisements
plz give me answer
plz give me answer  Discuss & Give brief description about string class methods   Java string methods
plz give me answer
plz give me answer   description about string class methods   Java string methods
plz give me answer
plz give me answer   description about string class methods   Java string methods
plz give me answer
plz give me answer   description about string class methods   Java string methods
Plz give java coding for this
Plz give java coding for this  ... iMin = 1, iMax = 8, iMid; // give max. value in even no. int jMin = 1, jMax = 12, jMid; // give max. value in even no. iMid = iMax / 2; jMid = jMax / 2
Plz give me code for this question
Plz give me code for this question  Program to find depth of the file in a directory and list all files those are having more number of parent directories
plz Help me find the correct programs answers
INDICA" and "TATA NANO" respectively. Plz mail me your answers...plz Help me find the correct programs answers   Create a washing machine class with methods as switchOn, acceptClothes, acceptDetergent, switchOff
StringIndexOutOfBound error !!! plz give me the reason for this error ,plz.........
StringIndexOutOfBound error !!! plz give me the reason for this error ,plz.........  import java.util.Scanner; class Even { static int getEven(int firstno,int secondno) { int counteven=0; for(int i=firstno;i<=secondno;i
how can i add wirecard option(or button ) at my web page plz tell all steps? View Answers
how can i add wirecard option(or button ) at my web page plz tell all steps? View Answers  how can i add wirecard option(or button ) at my web page plz tell all steps? View Answers
plz give me program to this: Given a string and a number ‘n’, find the ‘n’th distinct repeating character.
plz give me program to this: Given a string and a number ?n?, find the ?n?th distinct repeating character.    Given a string and a number ?n?, find the ?n?th distinct repeating character. For example, Input: Abracadabra, 1
Questions and Answers Help
programmers to give precise answers to your question. Describe your question...Questions and Answers Help      ...://www.roseindia.net/answers/viewqa/Java-Beginners/11976-Java-Hello-World-code
Questions and Answers Help
programmers to give precise answers to your question. Describe your question...Questions and Answers Help      ...://www.roseindia.net/answers/viewqa/Java-Beginners/11976-Java-Hello-World-code
Software Questions and Answers
by providing the answers to their questions online. Its very easy give the answer...Software Questions and Answers       View Software Questions and Answers online Discuss Software
Outsourcing - Answers to Critism, Outsourcing Answers Critics
Outsourcing - Answers to Criticism, Outsourcing Answers Critics Introduction As the outsourcing juggernaut rolls on, business analysts have come up with arguments favoring and criticizing it. Cost savings
I want this jsp answers
I want this jsp answers    How can we declare third party classes and interfaces inside our jsp page? How can we declare and definr global variables and methods inside our jsp page? If we are declaring global variables
I want this jsp answers
I want this jsp answers    How can we declare third party classes and interfaces inside our jsp page? How can we declare and definr global variables and methods inside our jsp page? If we are declaring global variables
Plz Help
Plz Help  Hello Guys!! Plz. Help I need to write a program to display the astrological sign based on your birthday for example If we enter the date of birth in the following format from console--13/08/1990 it should give you
plz plz plz inform me as soon as possible
plz plz plz inform me as soon as possible  ``by using c programs how to type
Software Questions and Answers
Software Questions and Answers View Software Questions and Answers online Discuss Software development questions, ask your questions and get answers... browse through these questions to find the answers to your software development
give answer
give answer  . Which of the following will he use to compile the KeyTest class successfully
give idea
give idea  how to plot graph in java   Please visit the following link: http://www.roseindia.net/java/example/java/swing/draw-simple-bar-chart.shtml
Core Java Interview questions and answers
Core Java Interview questions and answers  ... and answers in one place. These Core Java Interview Questions are supported with the answers, so that you don't have again search the internet to find
plz help
plz help  what is the procedure and code to design an interactive GUI in java using swings
plz plz rply as soon as possible
plz plz rply as soon as possible  by using c programs * * * * * s s s s s * s s o s s s s s s s s s s s s s s s s s s s s s s s
Gui plz help
Gui plz help   Create a Java application that would allow a person... ?Good Job? if the ratio of correct to incorrect answers exceeds 70% or you... it do only 10 questions for button1 and not able to add them so i can get answers
give the code for servlets session
give the code for servlets session  k give the code of total sample examples of servlet session
plz Help me - Java Beginners
plz Help me  Hi, I want learn struts,I dont have any idea about this plz help how can i make a framework.If u have any information then plz send my personal id plz tell me that whose software installed.and give me brief
Plz Plz reply Me - JSP-Servlet
Plz Plz reply Me  Respected Sir/madam, I am R.Ragavendran.. Actually I got your coding.. But This code is not enabling the user to click and change the image.. I request you to remember the code which you have provided for me
plz help me today plz plz - Java Interview Questions
plz help me today plz plz  2.) Suppose list is an array of six elements of type int. What is stored in list after the following java code executes? . for (i = 0; i < 5; i++) { list[i] = 2 * i + 5
Interview Questions and Answers
Interview Questions and Answers   ... that there cannot be just one answer to them. Your answers depend a lot on your particular... and experience. Therefore we have attempted to give you strategies to answer
How to give path to the Dfile?
How to give path to the Dfile?  Hello erveryone, I want to make... on sphinx, i have to give path to the sphinx4.jar file which is present in my... you give me the write path, please help me
Please give me the answer.
"int a=08 or 09" its giving compile time error why   "int a=08 or 09" its giving compile time error why ? can any one give me the answer of this please
give information or website address
give information or website address  hi i want u r help .... i m finding code for constructing graph in java but during execting them i have problem bec of packages... has i proceed i came to know
GIVE ME A ANSWER
GIVE ME A ANSWER  Discuss the Number Class in the java.lang package   Number class is an abstract class extended by all classes that represent numeric primitive types such as Byte, Short, Integer, Long, Float
Help me quickly plz??
Help me quickly plz??  Can you help me to write code quickly this code is a java code take input as double and should use command line arguments and enhanced for statement then find the combine of the numbers plz help quickly
give the code for this ques///
give the code for this ques///  write a program in java in which there is a clss readline. the functionality of this class is to read a string from the console and display it on the console .A point that should be keep in mind
Please give me coding for this..
Please give me coding for this..  Write an application that inputs one number consisting of five digits from the user.separates the number ibto its individual digits and prints the digits separated from one another by three
give the code for this ques///
give the code for this ques///  write a program in java which contains a class simple. this class contains 4 members variables namely a,b,c,and d. This class also contains 3 constructors of 2,3 and 4 arguments and a function
plz send code for this
plz send code for this  Program to calculate the sum of two big numbers (the numbers can contain more than 1000 digits). Don't use any library classes or methods (BigInteger etc
Plz Help Me
Plz Help Me  Write a program for traffic light tool to manage time giving between Main-Street and sub-Street. firstly, give green light for 40 seconds of the Main Street and then gives 15 second for the sub-street taking
Plz send - Java Beginners
Plz send  Hi, please send whole code i understood ur sending sql query Thanks  hai dear frnd........ look how can i write... be a troublesome...then again wat r ur needs.... so plz...provide a deatiled structure
Java application PLZ ?
Java application PLZ ?  Write an application that demonstrates each of the following methods, based on the statement String dedicate = ?Dedicated to making your event a most memorable one:; indexOf(?D?) charAt(15) endsWith(one
plz help me for this question
plz help me for this question  Apply simplex procedure to solve the L.P.P. maximize z = 3x1 + 4x2 subject to 5x1 + 4x2 ? 200; 3x1 + 5x2 ? 150; 5x1 + 4x2 ? 100; 8x1 + 4x2 ?? 80, x1 ? 0, x2 ? 0
plz help me - Java Beginners
plz help me  Thanks deepak continue response..i face some problem i... is true...but i very confuse that how it is not displayed admin page plz any one give me reponse my persinal given id  Hi ragni, i am sending
Advertisements
 

 

 

DMCA.com