Core Java Programming Challenges #3 | Coding Challenges | Naresh IT

แชร์
ฝัง
  • เผยแพร่เมื่อ 9 พ.ย. 2024

ความคิดเห็น • 46

  • @NareshIT
    @NareshIT  6 ปีที่แล้ว

    If you have any queries, Please ask our experts and Share your precious feedback in the comments, Learn from experts with our Online training Program, visit our website: goo.gl/hNPwDi ,Do not forget to subscribe and hit the bell icon for Future Tutorials updates.

  • @karangorai4401
    @karangorai4401 3 ปีที่แล้ว +10

    import java.util.Scanner;
    public class Challenge3 {
    public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    System.out.print("Enter an Integer :- ");
    int num = sc.nextInt();
    if(num % 2 == 0) {
    if(num 10 && num 20) {
    System.out.println("Bye");
    }
    }else {
    System.out.println("Hello");
    }
    }
    }

  • @arabindamohanty2190
    @arabindamohanty2190 4 ปีที่แล้ว +1

    Excellent 👌 great

  • @messicreation5204
    @messicreation5204 5 ปีที่แล้ว

    Thank you so much sir

  • @akhilraj5751
    @akhilraj5751 6 ปีที่แล้ว +2

    class Example
    {

    public static void main(String[] args){
    int n=20;
    if(n%2==0){
    if(n>=0&&n10&&n=20){
    System.out.println("bye");
    }
    }
    else {
    System.out.println("hellow");
    }
    }
    }

  • @nishantraj3869
    @nishantraj3869 2 ปีที่แล้ว +1

    public static void main(String[]args)
    {
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    if(a%2!=0)
    {
    System.out.println("Hello");
    }
    else if(a

  • @baapofstock5543
    @baapofstock5543 3 ปีที่แล้ว

    package practice;
    import java.util.Scanner;
    public class C1 {
    public static void main(String args[])
    {
    int x;
    Scanner sc = new Scanner(System.in);
    x=sc.nextInt();
    if(x%2==0)
    {
    System.out.println("hello");
    }
    else
    {
    if(0

  • @pankajaklade9963
    @pankajaklade9963 2 ปีที่แล้ว

    import java.util.Scanner;
    public class Challenge_03 {
    public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);
    System.out.println("enter a any number ");
    int num =sc.nextInt();

    if(num%2 != 0)
    {
    System.out.println("Hello");
    }
    else
    {
    if(0 < num && 10 > num)
    {
    System.out.println("Hii");
    }
    else if(10 < num && 20 > num)
    {
    System.out.println("Hello");
    }
    else
    {
    System.out.println("Bye");
    }
    }
    }
    }

  • @jaisreeramprasad8047
    @jaisreeramprasad8047 4 ปีที่แล้ว

    public class ScannerWithNestedIf{

    public static void main(String args[]) {

    int num;

    Scanner scan = new Scanner(System.in);
    System.out.println("enter a integer");
    num =scan.nextInt();
    if((num%2==0)) {

    if(num>20) {
    System.out.println("Bye" );

    }
    else if(num10) {
    System.out.println("Hello" );
    }
    else {
    System.out.println("Hi" );
    }

    }
    else{
    System.out.println("Hellow" );
    }

    }
    }

  • @virajovavenkata2191
    @virajovavenkata2191 3 ปีที่แล้ว

    import java.util.Scanner;
    public class Text1 {
    public static void main(String[] args) {
    Scanner obj = new Scanner(System.in);
    System.out.println("enter a number");
    int x = obj.nextInt();
    if(x % 2==0){
    if(x > 0 && x< 10){
    System.out.println("hi");
    }
    else if(x >= 10 && x < 20){
    System.out.println("hello");
    }
    else if(x >= 20){
    System.out.println("bye");
    }
    }
    else{
    System.out.println("number is odd");
    }
    }

  • @mdtausifiqbal
    @mdtausifiqbal 5 ปีที่แล้ว +1

    public class Main
    {
    public static void main(String[] args)
    {
    Scanner scan = new Scanner(System.in);
    int x = scan.nextInt();
    if(x % 2 != 0){
    System.out.println("Hello");
    }else{
    if(x >= 0 && x < 10){
    System.out.println("Hi");
    }
    if(x >= 10 && x < 20){
    System.out.println("Hello");
    }
    if(x >= 20){
    System.out.println("Bye");
    }
    }
    }
    }

  • @shilpar2298
    @shilpar2298 ปีที่แล้ว

    public class HelloHi {

    public static void main(String[] args) {
    Scanner sc= new Scanner(System.in);
    System.out.println("enter the value of x1");
    int x= sc.nextInt();

    if(x%2==1)
    {
    System.out.println("Hello");
    }
    else if(x%2==0)
    {
    if(x>=0 && x=10 && x20)
    {
    System.out.println("Bye");
    }
    }
    }
    }

  • @chanchalsahu7150
    @chanchalsahu7150 6 ปีที่แล้ว +1

    import java.util.Scanner;
    public class PC3
    {
    public static void main(String[] args)
    {
    Scanner input=new Scanner(System.in);
    int x=input.nextInt();
    if(x%2==0)
    {
    if(x>=0 || x=10 || x

  • @shubhammahadik2241
    @shubhammahadik2241 2 ปีที่แล้ว

    import java.util.Scanner;
    class check
    {public static void main(String [] args){
    int n;
    Scanner sc = new Scanner(System.in);
    System.out.println("ENTER NUMBER ");
    n = sc.nextInt();
    if (n%2 == 0)
    { if (n>=0 && n 10 && n

  • @renukadevi8154
    @renukadevi8154 6 ปีที่แล้ว

    import java.util.*;
    class Sample{
    public static void main(String s[]){

    Scanner sc=new Scanner(System.in);
    int x=sc.nextInt();

    if(x%2==1){
    System.out.println("Hello");
    }
    else {
    if(x>0 && x10 && x

  • @vinaykoudagani787
    @vinaykoudagani787 8 หลายเดือนก่อน

    package p1;
    import java.util.*;
    import java.util.Scanner;
    public class Challange3 {
    public static void main(String[] args) {
    Scanner s = new Scanner(System.in);
    try(s;){
    try {
    System.out.println("Enter the int value:");
    int x = s.nextInt();
    if(x%2!=0) {
    System.out.println("Hello");
    }if(x%2==0) {
    if(x>=0&&x10&&x20){
    System.out.println("Bye");
    }
    }
    }catch(InputMismatchException ime) {
    System.out.println("Invalid input...");
    }
    }// end of try with resources

    }
    }

  • @Yogesh-ld2js
    @Yogesh-ld2js 3 ปีที่แล้ว

    import java.util.Scanner;
    class Challenge3 {
    public static void main(String[] args) {
    Scanner scn=new Scanner(System.in);
    int n=scn.nextInt();
    if(n%2!=0){
    System.out.println("Hello");
    }
    else{
    if(n>=0 && n10 && n20)
    System.out.println("Bye");
    }
    }
    }
    }
    }

  • @kranjithkumar3060
    @kranjithkumar3060 4 ปีที่แล้ว

    import java.util.Scanner;
    public class Cge3 {
    public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int x = sc.nextInt();
    if(x % 2 != 0) {
    System.out.println("Hello");
    }
    else if(x % 2 == 0) {
    if(x>=0 && x=10 && x

  • @cricbuffofficial1
    @cricbuffofficial1 3 หลายเดือนก่อน

    import java.util.Scanner;
    public class Test{

    public static void main(String [] args)
    {
    Scanner sc=new Scanner(System.in);

    System.out.print("Enter a Number :");

    int num=sc.nextInt();

    if(num % 2==0)
    {
    if(num>0 && num10 && num20)
    {
    System.out.println("Bye");
    }


    }
    else
    {
    System.out.println("Hello");
    }
    }
    }

  • @jyotisankardas2036
    @jyotisankardas2036 5 ปีที่แล้ว

    import java.util.*;
    public class Main
    {
    public static void main(String[] args)
    {
    Scanner scn=new Scanner(System.in);
    System.out.println("give a integer number");
    int no=scn.nextInt();
    if(no%2!=0){
    System.out.println("Hello");
    }
    else{
    if(no>0 && no10 &&no20){
    System.out.println("Bye");
    }
    }
    }
    }

  • @jaimuruganantham3201
    @jaimuruganantham3201 5 ปีที่แล้ว

    import java.util.Scanner;
    public class IfClass
    {
    public static void main(Stirng args[])
    {
    Scanner Scan=new Scanner(System.in);
    int Number= Scan.nextInt();
    if(Number%2!=0)
    {
    System.out.println("Hello");
    }
    else
    {
    if(Number>=0&&Number

  • @SaritaSinghsarita
    @SaritaSinghsarita 4 ปีที่แล้ว

    import java.util.Scanner;
    public class Challange3 {
    public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int x= sc.nextInt();
    if(x%2 == 0)
    {
    System.out.println("Even");
    if( x>20)
    System.out.println("Even - bye");
    else if(x>10 && x0 && x

    • @Naninaninani5209
      @Naninaninani5209 6 หลายเดือนก่อน

      If the number is odd and greater than 20 then what will be the out put
      Hello and bye

  • @tapasnayak9867
    @tapasnayak9867 ปีที่แล้ว

    package pack5;
    import java.util.Scanner;
    public class ClassE
    {
    Scanner sc=new Scanner(System.in);
    public void meth1()
    {
    System.out.println("please enter the number:");
    int x=sc.nextInt();
    if(x%2==0)
    {
    System.out.println("This is a even number");
    if(x

  • @srinivasvenkata9069
    @srinivasvenkata9069 5 ปีที่แล้ว

    import java.util.Scanner;
    public class Challenge03
    {
    public static void main(String[] args)
    {
    Scanner sc=new Scanner(System.in);
    System.out.println("Enter a positive number:");
    int x=sc.nextInt();
    if(x>0){
    if(x%2==0){
    System.out.println("Even number");
    if(x>0&&x10&&x20){
    System.out.println("Bye");
    }
    }
    else{
    System.out.println("hello");
    System.out.println("odd number");
    }
    }
    else{
    System.out.println("please enter a value greater than 0 to enter into test cases");
    }
    }
    }

  • @jayant2716
    @jayant2716 4 ปีที่แล้ว

    import java.util.Scanner;
    public class Main
    {
    public static void main(String[] args)
    {
    Scanner s1=new Scanner(System.in);
    int x=s1.nextInt();
    if(x%2==0)
    {
    System.out.println("Number is even");
    if(x=10 && x

  • @psychogaming1425
    @psychogaming1425 5 หลายเดือนก่อน

    import java.util.Scanner;
    class Check {
    public static void main(String[] args) {
    System.out.println("Enter a number:");
    Scanner sc = new Scanner(System.in);
    int number = sc.nextInt();
    sc.close();
    if (number % 2 == 0) { // Check if number is even
    if (number == 0 || number

  • @saravanakumaran555
    @saravanakumaran555 6 ปีที่แล้ว +1

    give code explanation on core java so that it is easy for us to solve program in java for beginner we dont want faq in core java

    • @CrazyBuoy_97
      @CrazyBuoy_97 5 ปีที่แล้ว +4

      package codechef;
      import java.util.Scanner;
      public class corejavac1 {
      public static void main(String[] args) {
      // TODO Auto-generated method stub
      //System.out.println("Hi
      Hello
      Bye");
      int num;
      System.out.println("Enter a num:");
      Scanner sc=new Scanner(System.in);
      num=sc.nextInt();
      if(num%2==0)
      {
      if(num>=0&&num10&&num

  • @OfficialMudasir
    @OfficialMudasir ปีที่แล้ว

    challenge-3
    import java.util.Scanner;
    class Text{

    public static void main(String arg[]){

    System.out.println("Enter any Number :");
    Scanner sc = new Scanner(System.in);
    int n=sc.nextInt();


    if(n%2==1){

    System.out.println("Hello");
    }
    if(n%2==0){

    if(n>1 && n10 && n20){
    System.out.println("Bye");
    }
    }
    }

  • @satishkumar-bf3jy
    @satishkumar-bf3jy 5 ปีที่แล้ว

    sir, above 20(in last logic ) i m getting issue so plz hint me : thank you
    import java.util.Scanner;
    public class chn3
    {
    public static void main(String[] args)
    {

    System.out.println("enter the number");
    Scanner sc=new Scanner(System.in);
    int n= sc.nextInt();

    if(n%2==0)
    {

    //{System.out.println("odd hellow ");}
    if (n10 && n

  • @vijaysenreddykunduru
    @vijaysenreddykunduru 5 ปีที่แล้ว

    package challenge3;
    import java.util.Scanner;
    public class NestedIFExample {
    public static void main(String[] args) {
    // TODO Auto-generated method stub

    System.out.println("Enter any Number");

    Scanner scnr = new Scanner(System.in);
    int num = scnr.nextInt();
    if (num % 2 == 0) {

    if(num 10 & num 20) {
    System.out.println("Bye");
    }
    }

    else {
    System.out.println("Hello");
    }
    }
    }

  • @narsireddygade5413
    @narsireddygade5413 5 ปีที่แล้ว

    import java.util.Scanner;
    public class IfExample
    {
    public static void main(String[] args)
    {
    Scanner s = new Scanner(System.in);
    System.out.println("Enter an integer value...");
    int a = s.nextInt();
    if(a%2!=0)
    {
    System.out.println("It is Odd number...");
    }
    else
    {
    if((a>=0)&&(a10)&&(a

  • @vikaswaghmare8606
    @vikaswaghmare8606 6 ปีที่แล้ว

    import java.util.Scanner;
    public class v
    {
    public static void main(String []args)
    {
    Scanner sc=new Scanner(System.in);
    System.out.println("enter one integer number");
    int x=sc.nextInt();
    if(x%2==0)
    {
    if(x

  • @poonampatel-cn3ge
    @poonampatel-cn3ge 11 หลายเดือนก่อน

    import java.util.*;
    class Challang3{
    public static void main(String [] ar){
    System.out.println("Enter two number");
    Scanner sc=new Scanner(System.in);
    int x=sc.nextInt();
    if(x>0){
    if(x%2==0){
    System.out.println("odd");
    if(x>0&&x10&&x20){
    System.out.println("bye");
    }
    }
    else{
    System.out.println("Hello");
    System.out.println("odd number");
    }
    }
    else{
    System.out.println("plese enter greater than 0");
    }
    }
    }

  • @ShireeshaPulaganti
    @ShireeshaPulaganti 6 หลายเดือนก่อน

    import java.util.Scanner;
    class Hel {
    public static void main(String[] args) {
    Scanner s=new Scanner(System.in);
    int n=s.nextInt();
    if (n%2!=0){
    System.out.println("hello");
    }
    else if (n%2==0 && (n>0 && n10 && n

  • @SaiTechSolutions
    @SaiTechSolutions 5 ปีที่แล้ว +1

    import java.util.Scanner;
    class Test {
    public static void main (String[] args) {
    Scanner sc = new Scanner(System.in);
    System.out.println("ENTER NUMBER TO CHECK");
    int n = sc.nextInt();
    if(n % 2 == 0) {
    if(n >= 0 && n = 10 && n = 20) {
    System.out.println("Bye");
    }
    } else {
    System.out.println("Hello");
    }
    }
    }

  • @raviranjan7407
    @raviranjan7407 5 ปีที่แล้ว

    import java.util.Scanner;
    class Test{
    Public static void main(String[] args){
    Scanner sc=new Scanner(System.in);
    int x=sc.nextInt();
    if(x%2!=0){
    System.out.println("Hello");
    }
    else{
    if(x>=0 && x10 && x20){
    System.out.println("Bye");
    }
    }
    }
    }

  • @ashutoshpatil5942
    @ashutoshpatil5942 11 หลายเดือนก่อน

    import java.util.Scanner;
    public class Test {
    public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    if (n % 2 == 0) {
    System.out.println("Number is even");

    if (n > 0 && n < 10) {
    System.out.println("Hi");
    } else if (n >= 10 && n < 20) {
    System.out.println("Hello");
    } else if (n >= 20) {
    System.out.println("Bye");
    }
    } else {
    System.out.println("Number is odd");
    }
    }
    }