Conditional Statement Question

why does the condition of if statement evaluate to true

1
2
3
4
5
6
7
8
#include <iostream>

using namespace std;

int main() {
    if(3)
        cout << "It worked.\n";
} 
Last edited on
Any number other than 0 is true.
Thanks. :)
Topic archived. No new replies allowed.