This asks for year. Its the begining of program. Its part of a do while loop.
cout<<"Enter staring month ";
cin>>mnth1;
cout<<"Enter starting day ";
...
Type: Posts; User: Lonck
This asks for year. Its the begining of program. Its part of a do while loop.
cout<<"Enter staring month ";
cin>>mnth1;
cout<<"Enter starting day ";
...
because the assignment needs a switch and out of the entire program this part seems to be the most easy to change into a switch.
I tried this and it gives me an error at the begining saying: expected unqualified-id before "switch"
expected `,' or `;' before "switch"
this is what I wrote
switch (int leapyer)
{...
Yeah I changed the code from original to fit a function structure and I've prolly made a mistake. I changed it but it requires that (year%100!=0) not (year%100!==0) //extra "=" gives an error. ...
I need to turn this code into a case switch statement. Tried several times to change it but no luck. Anybody can help and point me to the right direction?
int leap (int year)
{
int...
Is there a way to write this differently, more simplistic? The codes above seem a little complex for me. I don't want to come off like an expert or something but I feel that my code isn't right,...
Im doing this days between dates prog and I need to shorten this fuction without loosing its purpose. Can someone help.
int days (int yer2,int yer1,int mnth2,int mnth1,int day1,int day2)
{
...
Wow I can't believe I didn't see that. Thnx guys. I need more practice in recognizing stupid mistakes like this.
#include <iostream.h>
#include <conio.h>
int main(){
int firstyer = 0;
cout<< "Enter -1 to stop program ";