admin@onlinelearningcenter.in (+91) 7 999 01 02 03

Segregate even and odd numbers in an Array

suraz Ghimire
5 Posts

Given an Array of Even and Odd numbers, Write a program to separate all the even numbers from odd numbers.

You should place all the even numbers first, followed by all the odd numbers.

 

Input: arr[] = 1 9 5 3 2 6 7 11
Output: 2 6 5 3 1 9 7 11

Input: arr[] = 1 3 2 4 7 6 9 10
Output:  2 4 6 10 7 1 9 3

 

 

Published By : suraz Ghimire
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.

Comments

Jquery Comments Plugin