Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- /**
- *
- */
- /**
- * @author Ravinesh
- *
- */
- public class que7_noDIV {
- /**
- * @param args
- */
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- Scanner in = new Scanner(System.in);
- System.out.println("Enter a number to check : ");
- int numb = in.nextInt();
- int temp ;
- for (int i = numb; i > 0; i -= 2) {
- // temp = numb - 2 ;
- if (i == 1){
- System.out.println("The Number is Odd");
- break;
- } else if (i == 0 ) {
- System.out.println("The Number is Even");
- break;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement