You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: public/consolidated/c.json
+3-20Lines changed: 3 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -7,10 +7,8 @@
7
7
"description": "Prints Hello, World! to the terminal.",
8
8
"author": "0xHouss",
9
9
"tags": [
10
-
"c",
11
10
"printing",
12
-
"hello-world",
13
-
"utility"
11
+
"hello-world"
14
12
],
15
13
"contributors": [],
16
14
"code": "#include <stdio.h> // Includes the input/output library\n\nint main() { // Defines the main function\n printf(\"Hello, World!\\n\") // Outputs Hello, World! and a newline\n\n return 0; // indicate the program executed successfully\n}\n"
@@ -25,26 +23,11 @@
25
23
"description": "Calculates the factorial of a number.",
26
24
"author": "0xHouss",
27
25
"tags": [
28
-
"c",
29
26
"math",
30
-
"factorial",
31
-
"utility"
27
+
"factorial"
32
28
],
33
29
"contributors": [],
34
-
"code": "int factorial(int x) {\n int y = 1;\n\n for (int i = 2; i <= x; i++)\n y *= i;\n\n return y;\n}\n"
35
-
},
36
-
{
37
-
"title": "Power Function",
38
-
"description": "Calculates the power of a number.",
39
-
"author": "0xHouss",
40
-
"tags": [
41
-
"c",
42
-
"math",
43
-
"power",
44
-
"utility"
45
-
],
46
-
"contributors": [],
47
-
"code": "int power(int x, int n) {\n int y = 1;\n\n for (int i = 0; i < n; i++)\n y *= x;\n\n return y;\n}\n"
30
+
"code": "int factorial(int x) {\n int y = 1;\n\n for (int i = 2; i <= x; i++)\n y *= i;\n\n return y;\n}\n\n// Usage:\nfactorial(4); // Returns: 24\n"
Copy file name to clipboardExpand all lines: public/consolidated/cpp.json
+7-15Lines changed: 7 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -7,10 +7,8 @@
7
7
"description": "Prints Hello, World! to the terminal.",
8
8
"author": "James-Beans",
9
9
"tags": [
10
-
"cpp",
11
10
"printing",
12
-
"hello-world",
13
-
"utility"
11
+
"hello-world"
14
12
],
15
13
"contributors": [],
16
14
"code": "#include <iostream> // Includes the input/output stream library\n\nint main() { // Defines the main function\n std::cout << \"Hello, World!\" << std::endl; // Outputs Hello, World! and a newline\n return 0; // indicate the program executed successfully\n}\n"
@@ -25,13 +23,12 @@
25
23
"description": "Convert vector into queue quickly",
0 commit comments