public static void main(String[] args) {
		int fibsum = 0;
		int a = 0;
		int b = 1;
		int finalsum = 0;
		while (fibsum <= 4000000){
			fibsum = a+b;
			a=b;
			b=fibsum;
			if(fibsum%2==0)
				finalsum+=fibsum;
		}
		System.out.println("The sum of the even-valued terms is: " + finalsum);
	}