Check out example codes for "if statement in c". It will help you in understanding the concepts better.

Code Example 1

#include <studio.h>
int main()
{
  if (logic goes here)
  {
    CODE
  }
  else if (logic)
  {
    CODE
  }
  else{
    CODE
  }
  return 0
}

Code Example 2

if (condition)
  action_1;     // condition is satisfied / TRUE
else
  action_2;		// condition is not satisfied / FALSE

Learn ReactJs, React Native from akashmittal.com