Example Code

Project Euler Problem 2 Solution using LabVIEW

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview
This example shows how to obtain the solution to the second problem in the Project Euler.


Description
This VI solves #2 of the Project Euler Problems. Problem description is:

By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms.

More info about the Project Euler Problems can be found here: http://projecteuler.net/


Requirements

  • LabVIEW Base Development System 2012 (or compatible)


Steps to Implement or Execute Code

  1. Open VI “Project Euler Problem 2 Solution 2012 NIVerified.vi”.
  2. Run the program.
  3. Observe that the solution is shown in the indicator.

 

Additional Information or References
VI Block Diagram

Block Diagram.png

 

 **This document has been updated to meet the current required format for the NI Code Exchange.**

J Newk
Systems Engineer
National Instruments

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.