IHYPRESS PROGRAMMING
Tutorials and C programs with code and output for beginners
c programming
HOME | ASP | C | CSS | GNUPLOT | HTML | JAVASCRIPT | PERL | PHP | PYTHON | RUBY | SVG
CData Types & Operators : Remainder Operator
<02.01>
/* The remainder (%) operator */
#include <stdio.h> int main (void) { int a, b, c, d; /* a few operations */ a = 10 % 3; b = -10 % 3; c = 10 % -3; d = -10 % -3; /* you need to double the % to display on screen */ printf ("10 %% 3 is %d\n", a); printf ("-10 %% 3 is %d\n", b); printf ("10 %% -3 is %d\n", c); printf ("-10 %% -3 is %d\n", d); return (0); }
Hergestellt in Deutschland / Made in Germany
10 % 3 is 1 -10 % 3 is -1 10 % -3 is 1 -10 % -3 is -1
COPYRIGHT © 2015-2024 IHY PRESS Frankfurt am Main 60329 Deutschland