Project Euler #2: Even Fibonacci numbers - Hacker Rank Program

Problem Statement
This problem is a programming version of Problem 2 from projecteuler.net
Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be:
1,2,3,5,8,13,21,34,55,89,
By considering the terms in the Fibonacci sequence whose values do not exceed N, find the sum of the even-valued terms.
Input Format
First line contains T that denotes the number of test cases. This is followed by T lines, each containing an integer, N.

Output Format
Print the required answer for each test case.

Constraints 1T105 10N4×1016
Sample Input
2
10
100
Sample Output
10
44
 
MY SOLUTION:
#include<stdio.h>
int main()
{
 long int testcase;
 scanf("%lld",&testcase);
 while(testcase--)
 {
  long long int value,fact=0,temp=0,odd=1,even=2,count=0;
  scanf("%lld",&value);
  temp=value;
  while(temp--)
  {
   fact=odd+even;
   odd=even;
   even=fact;
   if(value>fact)
   {
   if(fact%2==0)
   count+=fact;
   }
   else
   break;
   
  }
  printf("%lld\n",count+2);
 }
 return 0;
}

Convert resultset object to list of map

Convert the resultset object to list of map In some cases, while we doing API automation, we need to fetch the value from the DB and hav...