danguyenwork
10/12/2017 - 7:34 PM

If loop C++

# if loop
   int x = 0;  
   if (x == 0)  
   {  
      printf_s("x is 0!\n");  
   }  
   else  
   {  
      printf_s("x is not 0!\n"); // this statement will not be executed  
   }  

# mod
    if ( num % 2 == 0 )
    {
        cout << num << " is even ";
    }