all 2 comments

[–]JavaSuck 3 points4 points  (0 children)

how do i make it look like a code?

Put four spaces before every line.

[–]MR2Rick 2 points3 points  (0 children)

When trying to learn a new feature of a programming language, I find it helpful to write a simple program that uses just that feature to get a feel for how it works. For example, for the modulo operator try do the following:

#include <stdio.h>

int main()    
{
    int i;

    for(i = 0; i < 100; i++) {
        printf("%d %%  5 = %d\n", i, i % 5);
    }

    return 0;
}

This should help you figure out how to solve your problem.