Computer >> jsp >> How can I create a Java Program that counts down from 40 to 0 printing only the odd numbers and excl

How can I create a Java Program that counts down from 40 to 0 printing only the odd numbers and excl

The program has to exclude 3 and 33, and must use a continue and if statement??

I am able to create a program using the for statement, but not a while statement. Please help.

import java.util.*;

public class loop

{

public static void main (String[] args)

int count = 39;

while (count > 0)

if (count = 3)

exclude from statement

if count = 33

exclude from statement

System.out.print(count + " ");

count--

}

How can I create a Java Program that counts down from 40 to 0 printing only the odd numbers and excluding 3?

/*

He forgot that you need to use a continue statement...

*/

public class MyCounter {

聽public static void main(String args[]) {

聽聽int count = 40;

聽聽while (--count > 0) {

聽聽聽聽if (count % 2 == 0 || count == 33 || count == 3) continue;

聽聽聽聽else System.out.print(count + " ");

聽聽}

聽}

}

How can I create a Java Program that counts down from 40 to 0 printing only the odd numbers and excluding 3?

Easy. But first, names for class are by convention started with a Cap, variables are lowerCase humpback notation.

=================

/**

*

* @author blessed_thang

*/

public class OddCounter {

public static void main(String args[]) {

int topNum = 40;

while (topNum > 0) {

if (topNum % 2 != 0 && topNum != 33 && topNum != 3) {

System.out.print(topNum + " ");

}

topNum--;

}

}

}

C++......................?
is there a less complicated c++ compiler than microsoft express 2008? i found it to complicated and hav found no other free program to make a fps. a t..
C++???????
I am trying to make a tic tac toe game for c++ but i dont know how to use an array to make the board. also after i make the board hiw do i code it so ..
C++???????????????
I HAVE NO IDEA WHAT C++ IS? and i have an exam tomorrow. I dont understand 1. character set 2.tokens. i also have the for statement program, if stat..
C++..........................?
where i find the best c++ programing books.C++..........................?AT www.esnips.com/C++..........................?Try doing a search. OReilly t..
C++????????
i need to know a simple program to concat two strings without using strcat inside operator overloading.plz help me with a program..............C++????..
...................c++?
How would I create a program that that displays the sum of a sales amount in each of 4 regions, during a 3 month period, which would also display the ..
"Smitfraud-C. Toolbar888&..
I am a webmaster, and I am trying to build my website, but my computer keeps acting weird and seems to be going into random hybernation for no reason ..
C programme...?
I wrote a programme of calculator in C language. And it has two or three error so pl do correct them. And send me correct answer. Prog. is: #includest..
C programme...?
I wrote a programme of calculator in C language. And it has two or three error so pl do correct them. And send me correct answer. Prog. is: #includest..
C programme...?
I wrote a programme of calculator in C language. And it has two or three error so pl do correct them. And send me correct answer. Prog. is: #includest..
data computer viruses trojans
1 2 3 4 5 6 skin care 7 8 9 10 11 12 13 14 15 16 17 18 web hosting 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 pets 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100