Skip to content

Instantly share code, notes, and snippets.

Krzysztof Kowalczyk kjk

Block or report user

Report or block kjk

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View index.js
// :glot
const cars = ["Model 3", "Leaf", "Bolt"];
console.log("first car:", cars[0]);
const mixedTypes = ["string"];
mixedTypes.push(5);
console.log("array with mixed types:", mixedTypes);
View index.js
// :glot
let s = "my";
s = s + " message";
console.log(s); // -> my message
View index.js
// :glot
const i = 16;
const j = 38.53;
const z = i + j;
console.log(z); // -> 54.53
View main.cpp
// :glot
#include <iostream>
#include <string>
int main(int argc, char **argv) {
int a = 5; // 0101b (0x05)
int b = 12; // 1100b (0x0C)
int c = a | b; // 1101b (0x0D)
std::cout << "a = " << a << ", b = " << b << ", c = " << c << std::endl;
View main.cpp
// :glot
#include <iostream>
using namespace std;
auto main() -> int
{
for (int i = 0; i < 6; i++)
{
if (i % 2 == 0) // evaluates to true if i is even
continue; // this will immediately go back to the start of the loop
View main.cpp
// :glot
#include <iostream>
using namespace std;
auto main() -> int
{
for (int i = 0; i < 10; i++)
{
if (i == 4)
break; // this will immediately exit our loop
View main.cpp
// :glot
#include <iostream>
using namespace std;
auto main() -> int
{
int i = 0;
while (i < 10)
{
std::cout << i << " ";
View main.cpp
// :glot
#include <iostream>
using namespace std;
auto main() -> int
{
int i = 0;
do
{
std::cout << i;
View main.cpp
// :glot
#include <iostream>
using namespace std;
auto main() -> int
{
int i =0;
do
{
std::cout << i;
View main.cpp
// :glot
#include <iostream>
using namespace std;
auto main() -> int
{
int i =0;
do
{
std::cout << i;
You can’t perform that action at this time.