Rust program to find the EVEN numbers from the array

We saw a lot of information in the previous article. We are going to know about this very clearly in the article Rust program to find the EVEN numbers from the array. I think you will like this article very much. Let’s go into the article.

Rust program to find the EVEN numbers from the array

Rust program to find the EVEN numbers from the array

// Rust program to find the EVEN numbers
// from the array

fn main() {
    let arr:[i32;5] = [13,18,23,14,12];
    let mut i:usize = 0;
    
    println!("Even numbers are: ");
    while i<arr.len()
    {
        if arr[i]%2 == 0 {
            print!("{} ", arr[i]);
        }
        i = i + 1;
    }
}
Even numbers are: 
18 14 12

Final Words

Rust program to find the EVEN numbers from the array This article is your favorite topic because it is your favorite. And I will meet you in the next article.

Hi, I'm Selva a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Deekshi. Here, I post about programming to help developers.

Share on:

Leave a Comment