File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change 1+ {
2+ ' test_type ' : ' output_check' ,
3+ ' errors ' : " " "
4+ error_094.pwn(6) : error 094: division by zero
5+ error_094.pwn(7) : error 094: division by zero
6+ error_094.pwn(13) : error 094: division by zero
7+ error_094.pwn(14) : error 094: division by zero
8+ " " "
9+ }
Original file line number Diff line number Diff line change 1+ #include < console>
2+
3+ main ()
4+ {
5+ // Case 1: Both operands are compile-time constants
6+ printf (" %d " , 1 / 0 ); // error 094
7+ printf (" %d " , 1 % 0 ); // error 094
8+ printf (" %d " , 1 / 1 );
9+ printf (" %d " , 1 % 1 );
10+
11+ // Case 2: Only the divisor is a constant
12+ new var = 0 ;
13+ printf (" %d " , var / 0 ); // error 094
14+ printf (" %d " , var % 0 ); // error 094
15+ printf (" %d " , var / 1 );
16+ printf (" %d " , var % 1 );
17+
18+ printf (" %d " , 1 / var); // Just to make sure the error works only
19+ printf (" %d " , 1 % var); // if the divisor is a constant value
20+ }
You can’t perform that action at this time.
0 commit comments