function for getting the remainder?

Hi!

Can anyone help me if there is a function that gets the remainder of the quotient?

for example

int a;

a=6900/1000;

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

The program will print a=6.

How can I get the 900 remainder of what I divided?

BTW, I am programming using C not C++.

Thanks!
Last edited on
Use the modulus operator, %

strange, you should've know it, use % like: a = 6900 % 1000;
Thanks for the answers. Sorry I am just starting to learn C. I am not familiar with all the functions.

Thanks a lot!
Last edited on
Topic archived. No new replies allowed.