| 1 | #include <stdio.h> |
| 2 | #include <stdlib.h> |
| 3 | |
| 4 | // Function to calculate factorial |
| 5 | int factorial(int n) { |
| 6 | if (n <= 1) { |
| 7 | return 1; |
| 8 | } |
| 9 | return n * factorial(n - 1); |
| 10 | } |
| 11 | |
| 12 | int main(int argc, char *argv[]) { |
| 13 | /* Multi-line comment |
| 14 | Testing syntax highlighting */ |
| 15 | int num = 10; |
| 16 | float pi = 3.14159; |
| 17 | char message[] = "Hello, C!"; |
| 18 | |
| 19 | printf("%s\n", message); |
| 20 | printf("Factorial of %d is %d\n", num, factorial(num)); |
| 21 | |
| 22 | for (int i = 0; i < 5; i++) { |
| 23 | if (i % 2 == 0) { |
| 24 | printf("%d is even\n", i); |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | return 0; |
| 29 | } |