Poll Results
No votes. Be the first one to vote.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In C, you can declare a constant using the `const` keyword or by using the `#define` preprocessor directive.
1. Using `const`:
const int MY_CONSTANT = 10;
2. Using `#define`:
“`c
#define MY_CONSTANT 10
Both methods achieve the goal of creating a constant, but they have different behaviors and scopes. The `const` method allows for type safety, while `#define` is a preprocessor directive that creates a text replacement.