Search:

Type: Posts; User: cameuth

Search: Search took 0.01 seconds.

  1. like %2f rather than %d's or float rather and int

    like %2f rather than %d's or float rather and int
  2. changing data output from whole number to float two decimal places

    #include<stdio.h>
    //Write a function, invoked from the main function which will allow scanning data into the array.
    void input(int examscores[5][4])
    {
    int i,j;
    for(i=0;i<5;i++)
    {
    ...
  3. Thread: conio.h??

    by cameuth
    Replies
    4
    Views
    1,358

    conio.h??

    simple question here, I can't use conio.h for some reason in my program( I don't know much about it but I found it online), what else could I use to get the functions I want to call from conio.h?
  4. ok, I see that my function didn't take into...

    ok, I see that my function didn't take into account dates that like december 31, 2000 to jan 1, 2001. So that explains the if statement, if I put in your function as written, I keep getting 0 as my...
  5. I want the left over days in the month... why...

    I want the left over days in the month... why would I just take days_1?
  6. function for days between two dates in the same year

    alright, formerly this function was to go from a date to dec. 31st., but I've decided now it would be more effective to simply change it to the number of days between two dates. I've tried to alter...
  7. nevermind, I'm an idiot, disregard that.

    nevermind, I'm an idiot, disregard that.
  8. code won't compile, can't see the error, help troubleshooting

    My compiler tells me I have an error in line 100 with an output error in daysinmonth. This doesn't make sense to me as I wasn't messing with that function at the time it came out as an error. heres...
  9. Replies
    5
    Views
    2,741

    yep, realized it after I posted. got it now...

    yep, realized it after I posted. got it now though.
  10. Replies
    5
    Views
    2,741

    int leap(int year, int year_1) {...

    int leap(int year, int year_1)
    {
    for(year<year_1;(year%400 ==0 || (year%100 != 0 && year%4 == 0));year++)
    leapy++;
    }


    this reads out 0 instead of 100, how am i wrong now?
  11. Replies
    5
    Views
    2,741

    leap year function

    alright, now I need to get the following function to tell me the number of leap years between two dates. It reads


    int leap(int year, int year_1)
    {
    for((year%400 ==0 || (year%100 != 0 &&...
  12. Replies
    6
    Views
    966

    Oh, and I added line 7 because the values in the...

    Oh, and I added line 7 because the values in the same month were 1 day off, but I'm not sure how wise that was now...
  13. Replies
    6
    Views
    966

    ok, it now works for dates in the same month(and...

    ok, it now works for dates in the same month(and year of course), but the values come up about two months short for long amounts of time. For example, 1/1/1 to 12/31/1 comes out to 305 days. Here's...
  14. Replies
    6
    Views
    966

    AHA! the semicolon! Thanks, and hello again...

    AHA! the semicolon! Thanks, and hello again tater, always a pleasure!
  15. Replies
    6
    Views
    966

    I think that for loop is what causes my date...

    I think that for loop is what causes my date totals to be 60 and 61 for 1/1/1 to 1/1/1 and 1/1/1 to 1/1/2. I've toyed with it a bit, but I can't seem to find the exact logic problem.

    Am I...
  16. Replies
    6
    Views
    966

    function days from date to december 31st

    #include <stdio.h>
    #include <time.h>
    int days, month, year, days_1, month_1, year_1, leapy, ndays, ddays, days_total, days_beforeleap;

    int daysinmonth(int month) /*there is a problem in this...
  17. #include #include int days,...

    #include <stdio.h>
    #include <time.h>
    int days, month, year, days_1, month_1, year_1, leapy, ndays, ddays, days_total;

    int daysinmonth(int month) /*there is a problem in this statement, your...
  18. what if I changed my switch statement to this......

    what if I changed my switch statement to this...


    switch(month)
    {
    case 1:
    case 3:
    case 5:
    case 7:
    case 8:
  19. writing A function which gives the number of days between two dates in the same year

    alright, I've been working on a program that will give the number of days between two calendar dates. It is suggested that we write a function that gives the number of days between two dates in a...
  20. Replies
    4
    Views
    3,034

    Great! Thank you so much, I've now got my switch...

    Great! Thank you so much, I've now got my switch statement working. I am now attempting to write a function that tells me the time difference in two dates in the same year, so I can then multiply...
  21. Replies
    4
    Views
    3,034

    I've done my best to implement your changes. I do...

    I've done my best to implement your changes. I do my best to indent properly, but as this is my first time posting code online, I wasn't sure how to go about doing it in that format, I'll try to get...
  22. Replies
    4
    Views
    3,034

    switch statement problems: beginner in C

    hey guys, first time poster so let me know if I violate any basic rules, don't want to step on any toes. I'm taking a basic C programming class, and I'm having trouble with the following switch...
Results 1 to 22 of 22