C++ 4.3.2 (gcc-4.3.2) sample
Sure, here is a response:
#include <iostream>
int main() {
int number = 5;
if (number > 0) {
std::cout << "The number is positive" << std::endl;
} else {
std::cout << "The number is non-positive" << std::endl;
}
return 0;
}
Explanation: - This code includes the iostream library, which allows input and output operations. - The main function is the entry point of the program. - An integer variable "number" is declared and initialized with the value 5. - The if statement checks if the value of "number" is greater than 0. - If the condition is true, it prints "The number is positive" to the console. - If the condition is false, it prints "The number is non-positive" to the console. - Finally, the main function returns 0, indicating successful execution.