I have this file that has no extension (not just bcs it's hidden), so I don't know what to use to open it. Do you guys have any ideas on how to figure out what the file is?
oh, well, i fiddled some more with my little program, changed a few things (nothing inside teh while loop) and now it works (still have a float/an integer). But I honestly have no clue what made it work, in my opinion i changed nothing that should have affected that computation...:confused:
the compiler complains:
t.c: In function `main':
t.c:46: error: invalid operands to binary /
Might this be because I am dividing a float variable by an integer variable?
If this is the case, what should i do?
Thanks chroot. I didn't realize changing variables inside the while condition was sloppy. In fact, that was an idea i had taken from my class notes, my teacher had used the exact same example :while((x=getchar()), condition) {body}
I think my while loop works now. It puts the right things at...
Thanks guys, I think i get the idea of a while loop, but somehow the details still need a lot of improvement :redface:
This is the while loop i wrote
while((c=getchar()),c!='x'&&i<10)
{ printf("datapoint %d:", i+1);
scanf("%f", &point);
data[i]=point;
i=i+1;
}...
Hi guys, I'm really new to computer programming, and I've been sortof thrown into it without much introduction. This is a short C program I have to write for one of my physics courses.
To biggin with, the program has to prompt the user for a bunch of real numbers, which are to be stored in an...
The basic principle for this problem would be to use the Galilean transformation for inertial frames. In simpler words, if you know the velocity of an object in a moving frame, what is the velocity of that same object in a stationary frame?
Once you know this, you can use it's inverse into...
Why do you think the wind's pushing NW? He ends up southward from where he started, so I'd say the wind's pushing SW.
What do you have on your vector diagram? How would you go about this question? Try starting from the basic principles everytime you have trouble figuring out a problem.
How did you devise the empirical formula of the alkane was C_2 H_5?
If you're sure this is the right empirical formula, then you're basically done.
You now have to know a bit about alkanes.
An alkane is a chain of single-bonded carbons with enough hydrogens attached to each carbon...
The centre of mass is a point around which all the mass is symmetrically arranged.
Take the x direction for example. For what value of x would the mass be symmetrically distributed, i.e. you have the same mass to the right and to the left of your x value?
Note that if you balance your...
How would one use hubble's law to find the redshift of a galaxy 10^10 light years away? (in other words 3*10^9 pc)
All I know however is the version of hubble's where v=H_o d, with H_o=71 \frac{m}{s*pc}, which tells me that v= 2.2*10^11 m/s. But this violates the second principle of...
What exactly is the centre of mass?
Once you have the answer, you can "decompose" it into two components, x and y. So you'd basilcally find the centre line along x, then along y, and your centre point would be the intersection of the two.
I know it does not need to point in towards the center, but only needs to be perpendicular to the v vector.
That is precisely my question. Isn't the centrifugal force directed radially outward?