How to solve it?

Given N find sum of even numbers from 1 to N.
Given a Number N check if it Prime or Not?
Given a Number N check if it part of Fibonacci Series or Not?

@ayush8744hey
1- For sum of even no just start for loop from i=2 ;i<=N ;i+=2 - increment it with gap of 2 as even number are gap of 2 and just add i to total sum.
2. For prime you have to check divisibilty if it is divisible by any no from 2 to n then it is not prime else it is.
3. A number is Fibonacci if and only if one or both of (5n2 + 4) or (5n2 – 4) is a perfect square so find these values and check whether one or both are perfect square or not.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.