human
Even Fibonacci Numbers Sum | Returns sum of even Fibonacci numbers which are less than or equal to given limit ..
Initialize first two even prime numbers and their sum.
calculating sum of even Fibonacci value.
get next even value of Fibonacci sequence.
If we go beyond limit , we break loop.
Move to next even number and update sum.
Driver code"
Solution in Python:
assistant
#Here is code to even Fibonacci Numbers Sum and the other steps required.
 def evenFibSum ( limit ) :
	if ( limit < 2 ) :
		return 0
	ef1 = 0
	ef2 = 2
	sm = ef1 + ef2
	while ( ef2 <= limit ) :
		ef3 = 4 * ef2 + ef1
		if ( ef3 > limit ) :
			break
		ef1 = ef2
		ef2 = ef3
		sm = sm + ef2
	return sm
limit = 400
print ( evenFibSum ( limit ) )