Skip to content

Code 3 Interactive

Craft Apps & Games

  • Home
  • Tech News
  • Unity Tutorials
  • YouTube Channel
    • Mobile Apps
    • Online Course
    • Follow Us On
    • Contact Us
    • Patreon
    • Privacy Policy
  • Home
  • Unity Tutorials
  • Write a function that takes an array of integers and returns the sum of all even numbers in the array.
Unity Tutorials

Write a function that takes an array of integers and returns the sum of all even numbers in the array.

April 7, 2023February 12, 2023 Technology Researcher
int SumEvenNumbers(int[] arr)
{
    int sum = 0;
    foreach (int i in arr)
    {
        if (i % 2 == 0)
        {
            sum += i;
        }
    }
    return sum;
}

Technology Researcher

Analyst studies emerging trends in the information technology.

Related Posts

Unity Tutorials

Create a script that moves a GameObject forward in the direction it is facing.

April 28, 2023February 12, 2023 Technology Researcher
Unity Tutorials

Script that rotates a GameObject around a specific axis by a certain amount each frame.

April 21, 2023February 12, 2023 Technology Researcher

Post navigation

Previous: Script that allows a player to move a game object along a path using the arrow keys. The object should move forward when the up arrow is pressed and backward when the down arrow is pressed.
Next: Script that detects when a GameObject collides with another GameObject and logs the collision to the console.

Leave a Reply Cancel reply

You must be logged in to post a comment.

Support Developer

Donate

  • Donate withBitcoin
  • Donate Bitcoin to this address

    Scan to Donate Bitcoin to 19wTsPAw3joThSfF9m1sRGC9CfqpG9zkj9
    Tag/Note:- Minimum deposit 0.00000001 BTC Send only BTC to this deposit address. Ensure the network is BTC.
  • Donate withEthereum
  • Donate Ethereum to this address

    Scan to Donate Ethereum to 0x68ea21f63a7a47ad1d07ccce1e19d3e8931a5472
    Tag/Note:- Send only ETH to this deposit address. Ensure the network is ERC20.
  • Donate withXrp
  • Donate Xrp to this address

    Scan to Donate Xrp to rEb8TK3gBgk5auZkwc6sHnwrGVJH8DuaLh
    Tag/Note:- Memo ID: 105074699 Entering MEMO is required. Ensure the network is XRP. to send XRP else coin will not reach.
  • Donate withDogecoin
  • Donate Dogecoin to this address

    Scan to Donate Dogecoin to DLVw2DufgnsevAvnyNEJTxNPTr2ffbg12a
    Tag/Note:- Send only DOGE to this deposit address. Ensure the network is dogecoin.

Receive email updates when new articles are posted

Loading

All Rights Reserved 2022.
Proudly powered by WordPress | Theme: Fairy by Candid Themes.
en English
ur Urduhi Hindien Englishzh-CN Chinese (Simplified)pa Punjabide Germanes Spanishnl Dutchru Russianpt Portuguesefr Frenchit Italian