c++ Basic If_else Statements : I am a beginner of c++

This is the line of code I have written using if,else statements

     #include <iostream>
     #include <stdio.h>
     using namespace std;

    int main() {
	int a =5;
	if(a)
	{
	    printf("if %d\n" , ++a);
	}
	else
	printf("else %d\n" , a);
	
    }

what happens is if I take int a =5 it prints the value "if 6"

and if I Take int a =0   it prints the value "else 0"

Why is it happening what is the reason? 
