Search:

Type: Posts; User: Lonck

Search: Search took 0.01 seconds.

  1. This asks for year. Its the begining of program....

    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 ";
    ...
  2. because the assignment needs a switch and out of...

    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.
  3. I tried this and it gives me an error at the...

    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)
    {...
  4. Yeah I changed the code from original to fit a...

    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. ...
  5. How can I turn this code into a case switch statement?

    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...
  6. Replies
    5
    Views
    2,365

    Is there a way to write this differently, more...

    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,...
  7. Replies
    5
    Views
    2,365

    Need to simplify/shorten this code. Help.

    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)
    {
    ...
  8. Replies
    10
    Views
    1,557

    Wow I can't believe I didn't see that. Thnx...

    Wow I can't believe I didn't see that. Thnx guys. I need more practice in recognizing stupid mistakes like this.
  9. Replies
    10
    Views
    1,557

    Stuck in an infinite while loop. Help.

    #include <iostream.h>
    #include <conio.h>



    int main(){

    int firstyer = 0;

    cout<< "Enter -1 to stop program ";
Results 1 to 9 of 9