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



Home Answers Viewqa Java-Beginners how the answer is 13 can anyone explain plz

Have Programming Question? Ask it here!
 
 
 


prashant_angrish
how the answer is 13 can anyone explain plz
1 Answer(s)      8 months ago
Posted in : Java Beginners


public class that {

public static void main(String arr[])
{
    int i=3;
    int j=1;

    while(i<4)
    {
        //j=i;
        i=i+j/2;
    }
    System.out.println(i);
}

}


Advertisement
View Answers

August 15, 2013 at 1:14 PM


The answer will not be 13.nothing will be printed there, as while loop goes on executing infnitely.Because i=i+j/2;since it executes j/2 first(j value is 1) 1/2 becomes 0.As it is integer.and i value is 3+0=3 and it goes on infinitely.because for all time i value is 3 and 4>3 is true every time.



Related Tutorials/Questions & Answers:
how the answer is 13 can anyone explain plz
how the answer is 13 can anyone explain plz  public class that { public static void main(String arr[]) { int i=3; int j=1; while(i<4) { //j=i; i=i+j/2; } System.out.println(i
plz anyone can solve my
plz anyone can solve my  creat an applet prog which accepts the details of 10 customers like name , address , city , ect. and display it   import java.awt.*; import javax.swing.*; import java.awt.event.*; import
Advertisements
can u plz explain the http request methods - JSP-Servlet
can u plz explain the http request methods  can u plz explain http request methods? as well in jdbc...how to delete the duplicate records in database... duplicate entries in the MySQL database we can follow one of these following approach
plz give me answer plz
plz give me answer plz  writw a programme to find rank from an array using doubledimmensionalarray
plz answer - Java Beginners
plz answer   Write a Binary Search program that searches an array of ordered data. Compose an ordered array of 500 integers that contains the following series of numbers and run the search on it: 1, 2, 3, 5, 8, 13, 21, 34, 55
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 me answer
plz give me answer  Discuss & Give brief description about string class methods   Java string methods
Plz answer - Java Beginners
Plz answer  Create a Java Bean Class ‚?? Customer according to the below given class diagram. Customer... ------------------------------------------------- plz doreply me....thankz alot  
Plz send me answer quckly
Plz send me answer quckly  Respected Sir, myself is pavan shrivastava.i want ask a question that is ( we can't create object of interface then how would possible to create object
Can anyone assist with the coding of this game?
Can anyone assist with the coding of this game?  I am in need of the coding for this game. I need to write a "Hangman" game that will randomly generate a word from a text file and will prompt the user to guess one letter
can any one explain this
can any one explain this  class Clidder { private final void flipper() { System.out.println("Clidder"); } } public class Ex3 extends Clidder { public final void flipper() { System.out.println
plz. answer my ques - Java Beginners
plz. answer my ques  I want to ask a prog. prob which would create a prog that would simply take username and password as input and will display... such type of program is possible in c.  can you mention technology
can you explain ?
can you explain ?  my dear can you teel me the explaintion for this code i need it GregorianCalendar cal = new GregorianCalendar(y, m, 0...(); } } iam explain whole code exept this part can you help
plz explain me the output of program - Java Beginners
plz explain me the output of program  Hi friends, can u please explain me the output of below program with proper explanation of each and every line...,c.Through 'this' keyword,you can refer to any member of the current object from within
need the answer vry urgently..plz help me...[plzzzzzzzz
need the answer vry urgently..plz help me...[plzzzzzzzz  the question......to panda.pragnya7@gmail.com/panda_pragnya@yahoo.com...plz plz...help....me..it can change my lyfe...... useing struts or servlet... in eclipse platform...can any one tell me the source
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
can u plz help out how to attach file directly & send to a particular mail id
can u plz help out how to attach file directly & send to a particular mail id  i am building a project online LEAVE MANAGEMENT SYSTEM to our coll... for approval so i need ur guidance how to tackle this problem
can anyone help me to implement strength of the password - Security
can anyone help me to implement strength of the password  hi.. i have to implement password strength detection algorithm. How can i use dictionary in linux system
Please , can any one answer this Question?
Please , can any one answer this Question?  How to cummunicate one web application to another web application in different places
hello. can anyone help me with my java project, using jcreator?
hello. can anyone help me with my java project, using jcreator?  this is how it goes.. we are to develop a GUI of a certain form, in my case this one and then i should be able to create, view, search, and save using swamp.. i
it is a linux program is there anyone who can help me out with it?
it is a linux program is there anyone who can help me out with it?  Write a Bash script that prompts the user for a user-ID and displays the corresponding user√Ę‚?¨‚?Ęs login name, owner√Ę‚?¨‚?Ęs name, and his/her home directory
it is a linux question is there anyone who can help me out with it?
it is a linux question is there anyone who can help me out with it?  Write a script that accepts three numbers as parameters. Your script should add the first two numbers together and then call a second script that accepts two
What is the answer and how the program work?
What is the answer and how the program work?  public class Threads2... of method."); } } Which two can be results? (Choose two...; 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
CAN ANYONE SOLVE THIS FOR ME. URGENT HELP NEEDED. PLEASE HELP
CAN ANYONE SOLVE THIS FOR ME. URGENT HELP NEEDED. PLEASE HELP   The Task Write a class whose objects will represent students...?? otherwise. The overall mark can be calculated by multiplying both
CAN ANYONE SOLVE THIS FOR ME. URGENT HELP NEEDED. PLEASE HELP
CAN ANYONE SOLVE THIS FOR ME. URGENT HELP NEEDED. PLEASE HELP   Write a class whose objects will represent students.The class should have three... to 40 and √Ę‚?¨Ň?fail√Ę‚?¨¬? otherwise. The overall mark can
Can u Look to the error plz - Java Beginners
Can u Look to the error plz  this is my code can u modify it plz and give me the result of it when u check it on eclipse or jcreator plz and i...;where is the answer sir.? just i want from you to look what is the error plz
Explain how you overcame a major obstacle
Explain how you overcame a major obstacle       Qus. Explain how you overcame a major...-of-fact tone. This is a key point. 13. How long would you expect to work for us
can u plz try this program - Java Beginners
can u plz try this program  Write a small record management application for a school. Tasks will be Add Record, Edit Record, Delete Record, List Records. Each Record contains: Name(max 100 char), Age, Notes(No Maximum Limit
A few questions related to developing a blog....can anyone please help me out??
A few questions related to developing a blog....can anyone please help me out... jsp.I have a few questions.... Can anyone tell me if we can insert images...??If it is possible then how is it done?? If we can insert images in the textarea then how
need source code fir automatic timesheet filling. can anyone peass help?
need source code fir automatic timesheet filling. can anyone peass help?  Hi friends, I wants to develop a software that should automatically fills the time sheet using the login and log out entries. Can anyone please help me
how to get following answer in turbo c program
how to get following answer in turbo c program  input 123456789 output 1 2 3 4 5 6 7 8 9
How to Explain different way of using thread?
How to Explain different way of using thread?  Hi, How to explain how to using different thread in Java program
How to Explain different way of using thread?
How to Explain different way of using thread?  Hi, How to explain how to using different thread in Java program........   Hi, There are different types Thread in Java program. Here is the explain how to using thread
What are events? Explain how Event handling in Java?
What are events? Explain how Event handling in Java?  What are events? Explain how Event handling in Java?   Hi, The Events are the integral part of the java platform. Sometimes we want one object to perform shorten
How many objects are created in the code below? Explain.
How many objects are created in the code below? Explain.  Hi, Here is my code public static void main(String[] args) {String s1 = "abc"; StringBuffer s2 = new StringBuffer(s1); StringBuffer s3= s2; StringBuffer s4 = new
Explain about threads:how to start program in threads?
Explain about threads:how to start program in threads?  import.... It can be called as single unit of execution in a program. A program can have... to type something and show date and time simultaneously you can use threads
Can any one please help me in this ,,,,,,, need java code for this ,,,,please anyone
Can any one please help me in this ,,,,,,, need java code for this ,,,,please anyone  The Airport Valet Parking Company (AVP) is a company which provides a convenient medium cost parking solution to users of a local airport. Key
plz help me any one as fast as u can
plz help me any one as fast as u can  A thief Muthhooswamy planned... is the number of metres he can jump (1<=climbUp<=10^10) climbDown... Sample Input 1: 10:1:1:{10} Here Muthooswamy can jump 10 metres height
please reply fast if anyone knows that how to install mysql on windows using msi package
please reply fast if anyone knows that how to install mysql on windows using msi package  please reply fast if anyone knows that how to install mysql on windows using msi package   Hello Friend, visit here Thanks
Is there anyone out there?
Is there anyone out there?  Hi please could somebody respond as I am seeking advice but not getting any and do not know whether or not to continue using this site
NAME SORTING. . .anyone? - Java Beginners
NAME SORTING. . .anyone?  how can I sort names without using the 'name.sort' method? please help. . .anyone? the program should sort the first... friend, Please explain your details for complete Solution. For read
Chapter 13. Enterprise Bean Environment
Chapter 13. Enterprise Bean EnvironmentPrev Part I. Exam Objectives Next    Chapter 13... deployment descriptor. The Deployer can SET and MODIFY the values
Explain ServletContext.
Explain ServletContext.  Explain ServletContext.   Hi, Here is the answer, ServletContext interface is a window for a servlet to view it?s environment. A servlet can use this interface to get information
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
How can print integer in method
How can print integer in method   a method call process public process(int jobid,int remain){ } how to print int jobid ,int remain in for loop jobid in proc[0],remain in proc[1],both show in text file how to print proc[0
java.please answer this...
java.please answer this...   Q1).How we can write a complete JAVA program that computes the following summation formulas..? ‚??_(i=1)^n‚??„??i^2=„?? (n^(2 ) „??(n+1)„??^2)/4
How Jdbc program can be run??
How Jdbc program can be run??  import java.sql.*; import java.util.... to know what is the problem? and how can i run it successfully? please give me a satisfieng answer ,bcz i am not satisfied by ur previous answer... thank u
Explain Transparent Persistence - Hibernate
Explain Transparent Persistence   Hi Friends, Can u plz explain Transparent Persistence briefly  Hi Follow this link to find solution of your problem... http://www.roseindia.net/jdotutorials/jdo
 

 

 

DMCA.com