Results 1 to 7 of 7

Thread: i wanted to code of this program plz help me?

  1. #1
    karamatjognu's Avatar
    karamatjognu is offline Senior Member+
    Last Online
    1st January 2020 @ 10:39 AM
    Join Date
    19 May 2012
    Age
    31
    Gender
    Male
    Posts
    104
    Threads
    30
    Credits
    1,057
    Thanked
    3

    Default i wanted to code of this program plz help me?

    write a program in c++ that input 2 times from the user and display the sum of times plz master of c++ help me?

  2. #2
    Rohail_Ali is offline Junior Member
    Last Online
    18th December 2013 @ 07:14 PM
    Join Date
    05 Dec 2012
    Gender
    Male
    Posts
    3
    Threads
    0
    Credits
    0
    Thanked
    0

    Default

    #include<iostream>
    using namespace std;
    main()
    {
    int num1,num2;
    cout<<"Enter first number.\n";
    cin>>num1;
    cout<<"Enter second number.\n";
    cin>>num2;
    cout<<"There sum is = "<<num1+num2;
    return 0;
    }

  3. #3
    karamatjognu's Avatar
    karamatjognu is offline Senior Member+
    Last Online
    1st January 2020 @ 10:39 AM
    Join Date
    19 May 2012
    Age
    31
    Gender
    Male
    Posts
    104
    Threads
    30
    Credits
    1,057
    Thanked
    3

    Default

    waha yar kia program kar ke diya hai ***************
    Last edited by M-Qasim; 27th December 2013 at 06:53 PM. Reason: Don't Use Offensive Language, Last Warning Otherwise You will get Infraction

  4. #4
    Join Date
    22 Mar 2009
    Location
    Lahore
    Age
    33
    Gender
    Male
    Posts
    6
    Threads
    0
    Credits
    0
    Thanked
    0

    Default Time Calculator Code

    #include<iostream>
    #include<cstdlib>
    using namespace std;
    int main()
    {
    int tym1_h,tym1_m,tym2_h,tym2_m,hours,mins;
    strt:
    system("cls");
    cout<<"\n\t** Time Calculator **\n"<<endl;
    cout<<"Enter Starting Time ( Hours<space>Minutes ): ";
    cin>>tym1_h>>tym1_m;
    if(tym1_h>12)
    { cout<<"\n\nHours should b/w 1 to 12.\n"<<endl;
    system("pause");
    goto strt;
    }
    cout<<"Enter Ending Time ( Hours<space>Minutes ): ";
    cin>>tym2_h>>tym2_m;
    if(tym2_h>12)
    { cout<<"\n\nHours should b/w 1 to 12.\n"<<endl;
    system("pause");
    goto strt;
    }
    hours=tym1_h+tym2_h;
    mins=tym1_m+tym2_m;
    if(mins>60)
    {
    hours++;
    mins=mins-60;
    }

    cout<<"\n\n\t Total Time: "<<hours<<" Hours "<<mins<<" Minutes";

    return 0;
    }

    i think this is OK.. hain na.?

  5. #5
    Join Date
    22 Mar 2009
    Location
    Lahore
    Age
    33
    Gender
    Male
    Posts
    6
    Threads
    0
    Credits
    0
    Thanked
    0

    Default

    #include<iostream>
    #include<cstdlib>
    using namespace std;
    int main()
    {
    int tym1_h,tym1_m,tym2_h,tym2_m,hours,mins;
    strt:
    system("cls");
    cout<<"\n\t** Time Calculator **\n"<<endl;
    cout<<"Enter Starting Time ( Hours<space>Minutes ): ";
    cin>>tym1_h>>tym1_m;
    if(tym1_h>12)
    { cout<<"\n\nHours should b/w 1 to 12.\n"<<endl;
    system("pause");
    goto strt;
    }
    cout<<"Enter Ending Time ( Hours<space>Minutes ): ";
    cin>>tym2_h>>tym2_m;
    if(tym2_h>12)
    { cout<<"\n\nHours should b/w 1 to 12.\n"<<endl;
    system("pause");
    goto strt;
    }
    hours=tym1_h+tym2_h;
    mins=tym1_m+tym2_m;
    if(mins>60)
    {
    hours++;
    mins=mins-60;
    }

    cout<<"\n\n\t Total Time: "<<hours<<" Hours "<<mins<<" Minutes";

    return 0;
    }

    i think this is Ok.. hain na.?

  6. #6
    M-Qasim's Avatar
    M-Qasim is offline Advance Member+
    Last Online
    7th September 2022 @ 07:41 PM
    Join Date
    22 Mar 2009
    Gender
    Male
    Posts
    33,351
    Threads
    915
    Credits
    1,718
    Thanked
    3391

    Default

    Moved From C++ to AAE

  7. #7
    Punjabian5's Avatar
    Punjabian5 is offline Senior Member+
    Last Online
    1st February 2016 @ 05:13 PM
    Join Date
    04 Jun 2013
    Location
    lahore
    Gender
    Male
    Posts
    1,363
    Threads
    90
    Credits
    0
    Thanked
    71

    Default

    Quote karamatjognu said: View Post
    waha yar kia program kar ke diya hai *********************
    اپنا لہجہ تو تھیک کریں بھائی.
    Last edited by M-Qasim; 27th December 2013 at 06:54 PM. Reason: Quote Edited

Similar Threads

  1. Teach C++ With Arslan Wali (Daily Updates)
    By Arslan WALI in forum General Discussion
    Replies: 12
    Last Post: 22nd October 2012, 08:40 PM
  2. Mobile Security Code bhool janay ka hal Dekhen.
    By haris1210 in forum General Mobile Discussion
    Replies: 313
    Last Post: 16th June 2012, 09:39 PM
  3. Nokia Mobile Sets Secret Codes
    By majid786 in forum General Mobile Discussion
    Replies: 16
    Last Post: 24th March 2012, 03:48 PM
  4. Nokia 2170 Secret Codes
    By IT_DOCTOR in forum General Mobile Discussion
    Replies: 3
    Last Post: 24th March 2010, 09:32 AM
  5. Replies: 8
    Last Post: 19th May 2009, 05:51 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •