Title: Compiler Explorer
Open Graph Title: Compiler Explorer - C++
Description: #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN int factorial(int n) { return n <= 1 ? n : factorial(n-1) * n; } TEST_CASE("testing factorial") { CHECK(factorial(0) == 1); CHECK(factorial(1) == 1); CHECK(factorial(2) == 2); CHECK(factorial(3) == 6); CHECK(factorial(10) == 3628800); } // for more see https://hackingcpp.com/cpp/diagnostics.html#doctest
Open Graph Description: #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN int factorial(int n) { return n <= 1 ? n : factorial(n-1) * n; } TEST_CASE("testing factorial") { CHECK(factorial(0) == 1); CHECK(factorial(1) == 1); CHECK(factorial(2) == 2); CHECK(factorial(3) == 6); CHECK(factorial(10) == 3628800); } // for more see https://hackingcpp.com/cpp/diagnostics.html#doctest
Mail addresses
matt@godbolt.org
Domain: godbolt.org
| None | IE=edge |
| twitter:card | summary |
| og:image | https://github.com/compiler-explorer/infra/blob/main/logo/favicon.png?raw=true |
| og:image:secure_url | https://github.com/compiler-explorer/infra/blob/main/logo/favicon.png?raw=true |
| og:image:type | image/png |
| og:image:width | 145 |
| og:image:height | 145 |
| author | Matt Godbolt |
| notranslate | |
| theme-color | #f2f2f2 |
Links:
Viewport: width=device-width, initial-scale=1.0, user-scalable=no, shrink-to-fit=no