The final value of i is showing 4 but shouldn't it be 3 because it has been incremented only twice.
```public class Number
{
public static void main (String args[])
{
int i=0
while(i++<=1)
{
i++
System.out.print(i+" ")
}
System.out.print(i)
}
}
OUTPUT-
3 4
Answers
Answered by
1
Answer:
Here is your answer
Explanation:
Scanner reader = new Scanner(System.in);
int sum = 0;
while (true) {
int read = Integer.parseInt(reader.nextLine());
if (read == 0) {
break;
}
// DO SOMETHING HERE
System.out.println("Sum now: "+sum);
}
System.out.println("Sum in the end: "+sum);
Answered by
0
Answer:
cjhhkxchkjudzhi godly right to you later then I have been there I would have loved it and I was like oh my goodness you want me to come to take this time of the day dear friends are for the first place in a few days ago I
Similar questions