Skip to content

PajaritoMoyqi/Print_1_0_-1_in_different_ways

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

Intro

Print 1, 0, -1 in different languages, in different ways.

Now here exist 12 ways of priting 0 or 1 or -1.

Number of examples

per result

Result Number of examples
-1 1
0 8
1 3

per language

Language Number of examples
C 12

Code list

1: Trigraph sequence in C

printf( "%d", "??=" == "#" );

2: Digraph sequence in C

printf( "%d", "%:" == "#" );

3-4: ASCII code in C

printf( "%d", NULL );
printf( "%d", '�' );

5-6: Boolean in C

printf( "%d", a == 'b' );
printf( "%d", a == 'a' );

7-11: <limits.h> in C

printf( "%u", UINT_MAX + 1 );
printf( "%hhu", UCHAR_MAX + 1 );
printf( "%hu", USHRT_MAX + 1 );
printf( "%lu", ULONG_MAX + 1 );
printf( "%llu", ULLONG_MAX + 1 );

12: EOF in C

printf( "%d", EOF );

About

Print 1, 0, -1 in different languages, in different ways.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages