Results 1 to 8 of 8

Thread: c++ learning

  1. #1
    rashid832's Avatar
    rashid832 is offline Member
    Last Online
    4th October 2015 @ 05:09 PM
    Join Date
    02 Mar 2013
    Gender
    Male
    Posts
    685
    Threads
    120
    Thanked
    9

    Default c++ learning

    dosto kia koi mujhay bata sakta hy c++ walay jo code hotay hy is ko kis file may save kartay hy

  2. #2
    rashid832's Avatar
    rashid832 is offline Member
    Last Online
    4th October 2015 @ 05:09 PM
    Join Date
    02 Mar 2013
    Gender
    Male
    Posts
    685
    Threads
    120
    Credits
    0
    Thanked
    9

    Default

    jis tara ye culcolater ki coding hy is ko kis format may save karna hh


    #include <iostream>
    using namespace std;

    int main()
    {
    double num;
    double num2;
    char choice;
    for (;{
    do {
    cout << "Calculator\n";
    cout << "Choose one of the following options:\n";
    cout << "1 - Addition\n";
    cout << "2 - Subtraction\n";
    cout << "3 - Multiplication\n";
    cout << "4 - Division\n";
    cin>>choice;
    } while (choice < '1' || choice > '7' && choice != 'q');
    if (choice == 'q') break;
    switch (choice){
    case '1':
    cout << "Choose number\n";
    cin>>num;
    cout << "Other number to add\n";
    cin>>num2;
    cout<< "Result is " << num+num2;
    cout<<"\n";
    cout<<"\n";
    cout<<"\n";
    break;
    case '2':
    cout << "Choose number\n";
    cin>>num;
    cout << "Other number to substract\n";
    cin>>num2;
    cout<<"Result is " << num-num2;
    cout<<"\n";
    cout<<"\n";
    cout<<"\n";
    break;
    case '3':
    cout << "Choose number\n";
    cin>>num;
    cout << "Other number to multiply\n";
    cin>>num2;
    cout<<"Result is " << num*num2;
    cout<<"\n";
    cout<<"\n";
    cout<<"\n";
    break;
    case '4':
    cout << "Choose number\n";
    cin>>num;
    cout << "Other number to devise\n";
    cin>>num2;
    cout<<"Result is " << num/num2;
    cout<<"\n";
    cout<<"\n";
    cout<<"\n";
    break;
    default:
    cout<<"Choose other option\n";
    }
    }
    return 0;
    }

  3. #3
    rashid832's Avatar
    rashid832 is offline Member
    Last Online
    4th October 2015 @ 05:09 PM
    Join Date
    02 Mar 2013
    Gender
    Male
    Posts
    685
    Threads
    120
    Credits
    0
    Thanked
    9

    Default

    koi to help kar day

  4. #4
    aqigee is offline Senior Member+
    Last Online
    2nd January 2024 @ 12:58 AM
    Join Date
    23 Sep 2012
    Location
    Bahawalpur
    Age
    30
    Gender
    Male
    Posts
    279
    Threads
    27
    Credits
    1,174
    Thanked
    12

    Default

    name or phir .cpp

    Like

    Calculater.cpp

  5. #5
    sayhellotoit's Avatar
    sayhellotoit is offline Senior Member
    Last Online
    23rd September 2017 @ 07:51 PM
    Join Date
    01 May 2009
    Posts
    1,003
    Threads
    5
    Credits
    53
    Thanked
    127

    Default

    File name kay akhir mein cpp lagana hota hay (jaisay calculator.cpp).
    File save kernay kay baad issay kissi C++ compiler (jaisay BorlandC, TurboC, Dev-C++ wagaira) main compile kerna parta hay, phir iss ki exe file banti hay, jissay double-click kernay say aap ka program run hota hay.

  6. #6
    rashid832's Avatar
    rashid832 is offline Member
    Last Online
    4th October 2015 @ 05:09 PM
    Join Date
    02 Mar 2013
    Gender
    Male
    Posts
    685
    Threads
    120
    Credits
    0
    Thanked
    9

    Default

    kia ap is ko exe file bana sakty hy meray pass turboc++ hy jab may is ko compile karta ho to wo error deta hy

  7. #7
    sayhellotoit's Avatar
    sayhellotoit is offline Senior Member
    Last Online
    23rd September 2017 @ 07:51 PM
    Join Date
    01 May 2009
    Posts
    1,003
    Threads
    5
    Credits
    53
    Thanked
    127

    Default

    Code mein aik error hay.
    1. for (;{ ki jaga for ( ; ; ){ hona chahiyay tha.

    Baqi theek hay.
    #include <iostream>
    using namespace std;

    int main()
    {
    double num;
    double num2;
    char choice;
    for ( ; ; ){
    do {
    cout << "Calculator\n";
    cout << "Choose one of the following options:\n";
    cout << "1 - Addition\n";
    cout << "2 - Subtraction\n";
    cout << "3 - Multiplication\n";
    cout << "4 - Division\n";
    cin>>choice;
    } while (choice < '1' || choice > '7' && choice != 'q');
    if (choice == 'q') break;
    switch (choice){
    case '1':
    cout << "Choose number\n";
    cin>>num;
    cout << "Other number to add\n";
    cin>>num2;
    cout<< "Result is " << num+num2;
    cout<<"\n";
    cout<<"\n";
    cout<<"\n";
    break;
    case '2':
    cout << "Choose number\n";
    cin>>num;
    cout << "Other number to substract\n";
    cin>>num2;
    cout<<"Result is " << num-num2;
    cout<<"\n";
    cout<<"\n";
    cout<<"\n";
    break;
    case '3':
    cout << "Choose number\n";
    cin>>num;
    cout << "Other number to multiply\n";
    cin>>num2;
    cout<<"Result is " << num*num2;
    cout<<"\n";
    cout<<"\n";
    cout<<"\n";
    break;
    case '4':
    cout << "Choose number\n";
    cin>>num;
    cout << "Other number to devise\n";
    cin>>num2;
    cout<<"Result is " << num/num2;
    cout<<"\n";
    cout<<"\n";
    cout<<"\n";
    break;
    default:
    cout<<"Choose other option\n";
    }
    }
    return 0;
    }
    Ab try karain, compile ho jayay ga. Code aur exe bhi attach hay.
    Attached Files Attached Files

  8. #8
    rashid832's Avatar
    rashid832 is offline Member
    Last Online
    4th October 2015 @ 05:09 PM
    Join Date
    02 Mar 2013
    Gender
    Male
    Posts
    685
    Threads
    120
    Credits
    0
    Thanked
    9

    Default

    ok try karta ho hum nay koi softwere bana ho to humay ye code kis site say milay gay

Similar Threads

  1. Replies: 3
    Last Post: 20th November 2015, 06:50 PM
  2. distance learning institute without virtual learning
    By physiology in forum Educational Help
    Replies: 7
    Last Post: 13th April 2013, 05:27 PM
  3. -=<<Index - English Learning Course By Zaara>>=-
    By IT.BOY in forum English Learning Course
    Replies: 0
    Last Post: 13th July 2011, 09:48 PM
  4. Replies: 2
    Last Post: 25th January 2010, 05:34 PM
  5. Replies: 1
    Last Post: 6th January 2010, 11:06 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
  •