Read from Array integers and find divid of odd number | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Read from Array integers and find divid of odd number

Read from Array integers and find divid of odd number

10th Apr 2018, 12:12 AM
noura
2 Answers
+ 2
hi for finding odd numbers you can iterate through the array and check if the remainder of the integer by 2 is zero or not if not it's odd code is something like this: for (int i =0; i < yourArray.length ; i++){ if((yourArray[i] %2) != 0){ // the number is odd .... now you //can do whatever you want with // it }// end of if }//end of for
10th Apr 2018, 2:49 AM
Farshaad Heydari
Farshaad Heydari - avatar
0
What is code for this
10th Apr 2018, 12:12 AM
noura