I had to write a program that prompts the user for three integers representing the day, month, and year of a given date (e.g. 5 24 1994), and that displays the day of the week for the given date...
Type: Posts; User: s_ny33
I had to write a program that prompts the user for three integers representing the day, month, and year of a given date (e.g. 5 24 1994), and that displays the day of the week for the given date...
Can someone tell me the proper outlay of a custom header file in C? Thanks
Ok...I got rid of the negatives but now I'm not getting the number of coins. For example, if I put 50.25 for purchase and 20.21 for payment, I get only the bills, 1 twenty and 1 ten but no change.
...
Thank you. One small issue. Now I get negative numbers in my printf statement at the end. If I put total as say 20.00 and payment at 12.00, I get "-1 fives and -3 ones." They are all set to %d...
That was the question I posted. I'm not sure how to get the change.
I'm trying to write this program that asks for the purchase amount, the payment amount and then outputs the change in the number of bills and coins. I think I'm missing an 'if' statement for...
Can someone help me with how I should go about how the inputted date is stored? Also, what I need to do to compute the century and year in part (c) of this problem? I would greatly appreciate any...
Do I use an array for my scanf with a for loop?
Is this it...
M = ((26 * month) - 2) / 10;
Oh...I would replace 10 with month...right? Plus, add the other paren.
M = (26 * month) - 2)) / 10;
OK...I'll take a look at the adjusted month. I thought I may have to use a pointer to figure the year.
Thanks for the advice AD but if I don't think this through, I never learn C. Also, I think this assignment is looking for me to understand pointers (which is totally confusing to me) and probably...
I don't know if you can consider this an attempt, but like I said, I don't know how to get this going.
#include <stdio.h>
#include <stdlib.h>
Can anyone help me with this program. I don't even know where to start with this one. I really want to learn this so I'm not looking for complete code, just some guidance to help this rookie ...
Thanks for all your advice. I really appreciate it.
OK...first thing...cbastard...i don't drink. Maybe I should start though...maybe I'll write better code. So thanks for the advice. I've come to realize us newbies are susceptible to punishment....
I changed my code and I get the following erros:
sum.c: In function `main':
sum.c:30: warning: format argument is not a pointer (arg 2)
sum.c:43: warning: passing arg 1 of `findmax' makes...
Sorry...I was responding to the second poster first. I tried yours and it worked. I had to move the -o in the syntax. The -o went between somefile.c and somefile.exe. I then included what you stated...
Thanks...I tried the
gcc prog.c -o prog.ex > somefile.txt
...and it created the file but the file was empty. I tried looking at their documentation too and I couldn't find anything either. I'm...
does anyone know the command line syntax for the gcc compiler to output the compiler errors to a file?
I'm writing a program that prompts for ten integers, then stores these intergers in an array. Then the program computes and stores the sum and the largest and smallest of these integers. The program...
Oh no...not only does it return 1.000000 for the %f in my printf, but if I input 357, it returns the statement for water and not mecury. What am I doing wrong?
Here is the code:
/*
Filename: range.c
Description: Displays a substance if the observed boiling point is
within 5% of the expected boiling point.
OK...thanks. Why is the first %f in my printf statement return 1.000000 if the user inputs 97 ("data" variable)? Why doesn't this display 97?
That did it...thanks. Now I'm trying to do some formatting of my output but I get parse errors. Can someone tell me what is wrong with this? I addedd some words to the printf statement to make more...