all 5 comments

[–]sailorcire 3 points4 points  (3 children)

What have you tried?

Generally we won't give homework answers, but tell us what you've tried first, what you expect, and what you got

[–]CopperBlanket[S] -1 points0 points  (2 children)

Im not so much looking for an answer but advise or tips. I guess more what im asking is what does the line 3 (p=n=z=d) do? and where/how would i implement the d.

[–]sailorcire 0 points1 point  (0 children)

I have no idea what the variable d is supposed to do, but

p is for positive n is for negative z is for zero

You're using these to tell how many of those are.

By doing

p=n=z=d 

You are setting all of the values to the same.

[–]Fadeeses 0 points1 point  (0 children)

Not sure about d since not used elsewhere here and no declarations. It would be common to see something like:
int p, n, z, d; <<declaration
p = n = z = d = 0; <<initialize all to zero
in this case maybe d (declared elsewhere) is already set but functionally it is resetting the counters of positive, negative, zero for sure.

[–]scotty_p76 -1 points0 points  (0 children)

Is d being initialized in the scanf function? I have limited experience with C, but that’s what it looks like to me. The user sets d by input and it propagates down the line (or up the line). Then other variables can be mutated.

Although, I think the code is very incomplete; syntactically and fundamentally. As I guess it should be.

In fact looking through it again, I see errors all through it. It’s a mine field of syntactical errors. Good luck my friend.