x % y = ( x -(x/y) * y)

C

CBFalconer

ArWeGod said:
.... snip ...

Let's do the math (or arithmetic):

10 % 10 = 10 - ( (10/10, ie 1) * 10 (ie: back to 10)) = ZERO!!! Yay!
2 % 10 = 2 minus (2 divided by 10 times 10) = ?
Anyone.... Anyone...

Using the usual integer arithmetic, 2 / 10 is unequivicably zero.
After which zero times 10 remains zero, and that is the value of
the expression.
 
C

CBFalconer

soscpd said:
.... snip ...

By the way... CBFalconer, sorry about your wife, brother-in-law,
sister-in-law, cat and dog.

Thanks. I'm gradually realizing I'm probably not immortal.
 
A

ArWeGod

Please don't remove attributions.

Yeah. Sure. Ummm... what does that mean?

-ArWeNewHere
 
A

ArWeGod

ArWeGod said:
Yeah. Sure. Ummm... what does that mean?

-ArWeNewHere

Actually, I don't think I'll be back. This isn't what I thought it was. I
think what I want is a .NET group, not this one. This seems to be about
arguing about stuff from 20 years ago. I just want to learn to open some
files and print stuff. The printing of stuff seems even harder than posting
here, but if I get it to work, I will have spent my time better-er.

Peace.
 
S

santosh

ArWeGod said:
Yeah. Sure. Ummm... what does that mean?

Do you see the "ArWeGod wrote:" line above? That's an "attribution"
line. Similar lines should be automatically generated for each poster
whose text appears in a post, by just about every newsreader I'm aware
of, including Google Groups.

If on the off chance that yours doesn't then you should, if possible,
add them manually. They are not *absolutely* essential, but most
respondents will probably killfile you if you continue to post
unattributed quotes.
-ArWeNewHere

And the sig separator is usually of the form "-- \n" (as a C string).
Anything else is prone to be unrecognised as yours was.
 
S

santosh

ArWeGod said:
Actually, I don't think I'll be back. This isn't what I thought it
was.

And what was that?
I think what I want is a .NET group, not this one. This seems to
be about arguing about stuff from 20 years ago.

C is still widely used. It's use these days is largely "invisible" to
desktop application programmers, that's true, but I suspect that the
volume of new C code continues to be in the top five for all
programming languages.

<snip>
 
N

Nick Keighley

Actually, I don't think I'll be back. This isn't what I thought it was. I
think what I want is a .NET group, not this one. This seems to be about
arguing about stuff from 20 years ago. I just want to learn to open some
files and print stuff.

C does this

The printing of stuff seems even harder than posting
here, but if I get it to work, I will have spent my time better-er.

printing is pretty easy in C.


#include <stdlib.h>
#include <stdio.h>

int main (void)
{
FILE *in;
char line[80];

/* open a file */
in = fopen ("fred.dat", "r");

if (in == NULL)
return EXIT_FAILURE; /* file didn't open */

/* read a line */
fgets (line, sizeof line, in);

/* close file */
fclose (in);

/* print stuff */
printf ("stuff\n");

return EXIT_SUCCESS;
}



--
Nick Keighley

in comp.lang.c, the very people most capable of making the inference
are those least likely to make it. This newsgroup considers pedantry
to be an art form.
Richard Heathfield
 
C

CBFalconer

ArWeGod said:
Yeah. Sure. Ummm... what does that mean?

Do you see that initial line "ArWeGod wrote;"? My newsreader put
that there when I hit the reply command. It identifies who wrote
what in the quoted section. It has one less '>' leading it than
the material written by the attributee. Don't remove it if you are
quoting anything written by that attributee.

Try the following informative links:
<http://www.catb.org/~esr/faqs/smart-questions.html>
<http://www.caliburn.nl/topposting.html>
<http://www.netmeister.org/news/learn2quote.html>
 
R

Richard

Everybody loves a good chick fight!

Vippstar seems to have taken Chuck's role as Heathfields favourite
lackey.

We've seen "Indeed"s a plenty. A few "Chapter and Verse" and now the
ritual culling of anyone who doesn't worship the regs immediately.

Could be some good cat fights coming up to lighten the summer.
 
V

vippstar

And this answer means you are an idiot and useless to newbies.

No, I am correct that he is a troll. What *your* reply means, is that
you obviously miss a post or two.
"ArWeGod" only snipped the attributes when he replied to my message;
he did not snip attributes in latter or former messages.
 
D

David Thompson

Again you have to add extra conditions. It requires n > 1 and w >= 0.

n >= 1. Which all powers of an integer are usually taken to be.

- formerly david.thompson1 || achar(64) || worldnet.att.net
 
D

David Thompson

I'd have said exactly the opposite. It is not a C expression
(because x%y does not make sense on the right hand side of

an assignment), but it *is* a valid mathematical expression
(given a suitable definition of /). I've occaisionally
found it useful in languages that don't provide a remainder
operator.
- formerly david.thompson1 || achar(64) || worldnet.att.net
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,436
Messages
2,571,696
Members
48,796
Latest member
Greg L.
Top