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 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;
View main.cpp
// :glot
#include <iostream>
#include <string>
int main(int argc, char **argv) {
int a = 5; // 0101b (0x05)
a |= 12; // a = 0101b | 1101b == 13
std::cout << "a = " << a << std::endl;
}
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>
int main(int argc, char **argv) {
int a = 5; // 0101b (0x05)
a &= 10; // a = 0101b & 1010b == 0
std::cout << "a = " << a << std::endl;
}
View main.cpp
// :glot
#include <iostream>
int main(int argc, char **argv) {
int a = 6; // 0110b (0x06)
int b = 10; // 1010b (0x0A)
int c = a & b; // 0010b (0x02)
std::cout << "a = " << a << ", b = " << b << ", c = " << c << std::endl;
}
You can’t perform that action at this time.