like %2f rather than %d's or float rather and int
Type: Posts; User: cameuth
like %2f rather than %d's or float rather and int
#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++)
{
...
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?
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...
I want the left over days in the month... why would I just take days_1?
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...
nevermind, I'm an idiot, disregard that.
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...
yep, realized it after I posted. got it now though.
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?
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 &&...
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...
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...
AHA! the semicolon! Thanks, and hello again tater, always a pleasure!
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...
#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...
#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...
what if I changed my switch statement to this...
switch(month)
{
case 1:
case 3:
case 5:
case 7:
case 8:
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...
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...
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...
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...