Frequently Asked Java Program 15: Print Even & Odd Numbers from an Array

แชร์
ฝัง
  • เผยแพร่เมื่อ 10 ต.ค. 2019
  • Topic : Print Even & Odd Numbers from an Array
    #########################
    Udemy Courses:
    #########################
    Manual Testing+Agile with Jira Tool
    ************************************
    ► shorturl.at/xNXZ4
    Selenium with Java+Cucumber
    ********************************
    ► shorturl.at/aIKMW
    Selenium with Python & PyTest
    ********************************
    ► shorturl.at/ELW09
    Selenium with python using Robot framework
    ****************************************
    ► shorturl.at/bcDPZ
    API Testing(Postman, RestAssured & SoapUI)
    *****************************************
    ► shorturl.at/uAWY7
    Web & API Automation using Cypress with Javascript
    ********************************************
    ► rb.gy/4uum2n
    Playwright with Javascript
    **************************
    ► shorturl.at/gALZ1
    Jmeter-Performance Testing
    ************************
    ► rb.gy/ocj7r2
    SDET Essencials(Full Stack QA)
    *************************
    ► rb.gy/hlnf2v
    Appium-Mobile Automation Testing
    ************************************
    ► rb.gy/wmzv64
    Java Collections
    *****************
    ► bit.ly/3S66ezE
    Python Programming
    *********************
    ► urlis.net/gdsfpb0s
    Cucumber BDD Framework
    ***************************
    ► bit.ly/3F7d69r
    Protractor with Javascript
    ***************************
    ► urlis.net/4uddm1qb
    ####################################
    TH-cam Playlists:
    ####################################
    Manual Testing & Agile
    ***********************
    ► bit.ly/3ujvaYa
    ► bit.ly/3OYzxQj
    SQL
    *************************
    ► bit.ly/3R6XjeG
    ► bit.ly/3nE0a1s
    ► bit.ly/3IeKuuJ
    linux & Shell Scripting
    **********************
    ► bit.ly/3up1Z6a
    ► bit.ly/3nzvGxx
    Java
    **********************
    ► bit.ly/3R9QfOs
    ► bit.ly/3AoRMKM
    ► bit.ly/3IbTTDn
    ► bit.ly/3ybXInv
    ► bit.ly/3yCoHdw
    Selenium With Java+Cucumber
    ********************************
    ► bit.ly/3P2FMm4
    ► bit.ly/3yhiIt4
    ► bit.ly/3uokzet
    ► bit.ly/3a7XIND
    ► bit.ly/3umN2S9
    ► bit.ly/3aar7GW
    ► bit.ly/3y9kD2S
    ► bit.ly/3uhLskn
    Python
    ********************************
    ► bit.ly/3agNgU0
    ► bit.ly/3NJNnoy
    ► bit.ly/2CTQ4mR
    ► bit.ly/3OIYWh1
    Selenium With Python,Pytest&Behave
    ***************************************
    ► bit.ly/3OHHoC9
    ► bit.ly/3IeNLdv
    ► bit.ly/2J4tPeT
    ► bit.ly/3ydSkAq
    Selenium With Python Using Robert Framework
    (Web&API Testing)
    *************************************************
    ► bit.ly/3nUvlpr
    ► bit.ly/3nUvE3z
    API Testing (Postman,SoapUi,&Rest Assured)
    **********************************************
    ► bit.ly/3OXacWY
    ► bit.ly/3yh0UhE
    ► bit.ly/3nC9DWQ
    ► bit.ly/3yGfhNS
    ► bit.ly/3OJa11H
    ► bit.ly/3P2slCC
    Mobile App Testing Appium
    ****************************
    ► bit.ly/3Al49HG
    Performance Testing Jmeter
    *******************************
    ► bit.ly/3nz4fE7
    Maven,Jenkins,Git,Github,CI/CD
    *******************************
    ► bit.ly/3P16HPj
    ► bit.ly/3yhlUVA
    ► bit.ly/3afYfwT
    ► bit.ly/3yGzweG
    ► bit.ly/3yF73Ws
    ► bit.ly/3NCOmH7
    SQL,DB Testing&ETL,Bigdata
    *******************************
    ► bit.ly/3NKOcNY
    ► bit.ly/3OVpDyI
    ► bit.ly/3NEvUy0
    ► bit.ly/3IryxlT
    ► bit.ly/3RkWBLh
    JavaScript Based Automation Tools
    ********************************
    ► bit.ly/3nUx51X
    ► bit.ly/3AqI6Q0
    ► bit.ly/3yeurbT
    ► bit.ly/3ujzpTK
    Selector Hub Tools
    ********************
    ►rb.gy/h3h424
    GraphQL
    ******************
    ► rb.gy/sj3gys
    Cypress API Testing
    ********************
    ► shorturl.at/fjKPX
    Cypress Web Testing
    **********************
    ► shorturl.at/agjlK
    Playwright with Javascipt
    **************************
    ► shorturl.at/adSTY
    #JavaEvenOddArray
    #ArrayEvenOddJava
    #EvenOddNumbers
    #ArrayManipulation
    #JavaProgramming
    #ArrayOperations
    #EvenNumbers
    #OddNumbers
    #ArrayIteration
    #JavaArrays
    #ProgrammingLogic
    #JavaCode
    #CodingPractice
    #LoopingInJava
    #ArrayTraversal
    #JavaTips
    #JavaTricks
    #Algorithm
    #JavaDevelopment
    #CodeExamples
    #JavaLearning
    #JavaBasics
    #ProgrammingInJava
    #CodingInJava
    #LogicBuilding
    #ArrayPrinting
    #JavaFunctions
    #EvenOddLogic
    #JavaProblemSolving
    #ArrayManipulation
    #JavaSnippets
    #CodingChallenges
    #JavaArrays101
    #LogicalThinking
    #JavaAlgorithms
    #ArrayAlgorithms
    #JavaHelp
    #JavaCommunity
    #JavaTricks
    #CodeTips
    #JavaCoders
    #ProgrammingHelp
    #JavaSolutions
    #ArrayProblems
    #JavaPuzzles
    #CodeOptimization
    #JavaTraining
    #LearnJava
    #JavaTutorials
    #ProgrammingProblems

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

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

    I need same program but allow user to enter 10 numbers, and how may it print in descendent values

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

    Good day sir! What if the numbers were not given at all? how can we do that

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

    What if you want to print the array to the console with only the even numbers?

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

    Thank you, now it "clicked" for me :)!

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

    public class PrintEvenOddNumbersFromArray {
    public static void main(String[] args) {
    String odd="";
    String eve="";
    int arr[]={1,2,3,4,5};
    for(int i=0;i

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

    Why it's not showing duplicate local variable i

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

    Thank you sir, I have zero knowledge in coding. very easy understandable. 😀👍🤝

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

      Glad to hear that

  • @prasannachukka6643
    @prasannachukka6643 4 ปีที่แล้ว +3

    sir plz do on video about printing pattern

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

    what if the pattern is different like {3,2,1,5,6,4}? Will it still get the odd and even numbers in any oreder?

  • @yamunashushma1834
    @yamunashushma1834 3 ปีที่แล้ว +6

    Sir instead of using !=0 we use ==1 in odd numbers if statement

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

      No, I think you can't write ==1 for odd numbers because in some conditions the remainder may come other than 1 and it will be an odd number but the line will only execute only if remainder is equal to 1.so, it is better to write ! =0 so that whatever the remainder will be other than 0 it will be an odd.

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

    Hi Praveen , how to do a pattern program.

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

    Thank you, this really helps alot

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

    Excellent 👌

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

    Can anybody solve thi in O(n) means only using one loop

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

    do we need two for loops for this

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

      I think no we can get The odd numbers within only one for loop by writing else statement

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

    Sir can we use i

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

      we wont be using it here cause the loop will run for (a.length-1) which means from 1 to 5...it wont be taking the last value at all.
      comparing it with index that it will run from (0 to n-2) for the given loop.
      i hope it is clear to you :)

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

    In my interview they asked the below Question,can I get answer for this ....
    How can we extract number from each digit and we need digit as a even or odd number

  • @gauri992
    @gauri992 3 ปีที่แล้ว +1

    Thankyou sir ur the best

  • @jnp9155
    @jnp9155 2 ปีที่แล้ว +3

    i have encountered this question in interview and i was not able to give the answer so i was rejected. please guide all type of basic program task question which will be asked in interview.

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

      In which company they this asked this question

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

    Thanks a lot sir

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

    thank you so much bro

  • @SurajSingh-sy9kr
    @SurajSingh-sy9kr ปีที่แล้ว +1

    helpful video sir

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

    Commenting for better reach

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

    public class Even_Odd_from_Array {
    public static void main(String args[]) {
    int a[] = {2,3,4,5,6,7,8,9};
    List even = new ArrayList();
    List odd = new ArrayList();

    for(int i = 0;i

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

    🇮🇳🇮🇳🙏🙏👍👍

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

    i tried this way
    public static void main(String[] args) {
    int a[] = {1,2,3,4,5,6,7,8,9,10};
    String even = "";
    String odd = "";
    for(int i = 0; i