We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- C
- Introduction
- Functions in C
- Discussions
Functions in C
Functions in C
Sort by
recency
|
838 Discussions
|
Please Login in order to post a comment
Less Code:
Patch:
This is a great introduction to understanding functions in C! 11xplay pro
Since this problem is still at the basic stage (no loops, macros, or conditionals introduced yet), I thought I'd share a solution that sticks to the fundamentals: just functions and some simple math.
I’ve seen many solutions here that use macros or ternary operators, which are definitely efficient, but I wanted to explore if we can solve it differently.