I figured out where my problem is but I need help correcting it. For some reason my distance formula is not working out. It should work out that the two smallest distances should equal the bigger...
Type: Posts; User: IxTanGxI
I figured out where my problem is but I need help correcting it. For some reason my distance formula is not working out. It should work out that the two smallest distances should equal the bigger...
I did not think indention would make a difference when it runs. I tried it anyways and it did not work.
I am making a martian leap year program(pointless program for class). This is the given :
1) All odd years are leap years.
2) All years divisible by 8, but not by 32 are leap years. (Thus, 8, 16...
The if- statements are still not working. This is what I have:
#include <stdio.h>
#include <math.h>
int main() {
int x1,x2,x3,y1,y2,y3,a1,a2,a3,a4,a5,a6;
tried that after I posted. Still same result
For some reason I can not get the if statements at the end to work. Atleast one of the if statements should work during each run of the program. Thanks in advance.
#include <stdio.h>...
Thanks for catching that. I am using Jgrasp with GCC.
I fixed that problem and the output is still incorrect. For c12 I get the correct answer but for c13 and c14 I am getting 1627902208.00.
#include <stdio.h>
#include <math.h>
int main() {
Why are the last two equations printing the wrong numbers? Thanks in advance.
#include <stdio.h>
#include <math.h>
int main() {
Sorry I forgot a a period in the print function at the bottom. The corrcted one and still not working:
#include <stdio.h>
int main(){
float distance, speed1, speed2, minutes, mainrate,...
This is what I need to write: Imagine a two-way straight railway and two trains approaching each other from opposite directions. You need to compute how long (in minutes) would it take for these...
Please Help.
int main()
{
int index, points[6];
char input[250], output[250];
FILE *ifp, *ofp;
printf("Which file would you like to read from?\n");
scanf("%s", input);
fixed...
int main()
{
int index, points[6];
char input[250], output[250];
FILE *ifp, *ofp;
printf("Which file would you like to read from?\n");
Thanks so much, now that part works. You will hear more from me in other threads. I still have a lot to go :) haha
I think I might have got it... Does this make any sense?
int main()
{
int index, points[6];
char *input, *output, a, b;
FILE *ifp;
I really did'nt understand the FAQ at all. I cleaned up the code a bit...
int main()
{
int index, points[6];
char *input, *output;
FILE *ifp;
Sorry did'nt see you posted a FAQ. I will read that over.
Im sorry I am real new to pointers. Can you please explain too me how I would point to something and why? Thank you in advance for the help.
Please any advice??? It is due tonight
int main()
{
int index, points[6];
char *input, *output;
FILE *ifp;
printf("Which file would you like to read from?\n");
scanf("%s", input);
printf("Which file would you like to...
int main()
{
char *input, *output;
FILE *ifp;
printf("Which file would you like to read from?\n");
scanf("%c", &input);
if ((ifp = fopen(input, "r")) == NULL)
{
thanks
I am trying to open a file to write too but the user needs the ability to select what file they want to open. How do I use fopen to open a string and not a filename?