Skip to content

m7mdsbbagh/cpp-odd-numbers-array

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

odd-array-filter

Generate a random array, sort it, extract the odd numbers.


How it works

  1. Enter how many elements you want (1–100)
  2. The array fills with random numbers between 1 and 100
  3. It sorts, then pulls out every odd number into a second array

Output

Enter number of elements (1-100): 10

Array 1 elements:
 3 12 19 24 35 47 58 61 73 90

Array 2 ODD numbers:
 3 19 35 47 61 73

Build & run

g++ -o odd_filter main.cpp
./odd_filter

Made with C++

About

C++ program that generates a random sorted array and extracts odd numbers into a separate array.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages