Page 1 of 9 1234 ... LastLast
Results 1 to 12 of 106

Thread: Simple Maths Program

  1. #1
    Omer27's Avatar
    Omer27 is offline Advance Member
    Last Online
    30th January 2024 @ 04:01 PM
    Join Date
    27 Jan 2009
    Age
    31
    Posts
    1,725
    Threads
    72
    Credits
    1,374
    Thanked
    66

    Default Simple Maths Program

    آج جو پروگرام میں پوسٹ کر رہا ہوں اس سے آپ پلس ، مینس وغیرہ کر سکتے ہیں.
    اس پروگرام کو رن کریں اور بتایں کے کیسا لگا



    #include<iostream>
    using namespace std;
    void main();

    void MainMenu()
    {
    cout<<" 1.Addition"<<endl;
    cout<<" 2.Subtraction"<<endl;
    cout<<" 3.Multiplication"<<endl;
    cout<<" 4.Division"<<endl;
    cout<<" 5.Remainder"<<endl;
    cout<<" 6.Factorial"<<endl;
    cout<<" 7.Even or Odd"<<endl;
    cout<<" 8.Exit"<<endl<<endl;
    cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~"<<endl;
    }

    void Add()
    {
    system("color 4a");
    cout<<"~~~~~~~~~~~~~~~You Choose Addition~~~~~~~~~~~~~~"<<endl<<endl;
    double a,b;
    cout<<"Enter the Value of A = ";
    cin>>a;
    cout<<"Enter the Value of B = ";
    cin>>b;
    cout<<endl;
    cout<<a<<" + "<<b<<" = "<<a+b<<endl<<endl;
    cout<<"1.For Again Addtion"<<endl;
    cout<<"2.Back to Main Menu"<<endl;
    cout<<"3.Exit"<<endl;
    int o;
    cout<<endl;
    cout<<"~~~~~~~~~~~~~~~~~~"<<endl;
    cout<<"Enter Option = ";
    cin>>o;
    cout<<endl;
    cout<<"~~~~~~~~~~~~~~~~~~"<<endl;
    cout<<endl<<endl;
    switch(o)
    {
    case 1:
    Add();
    break;
    case 2:
    main();
    break;
    case 3:
    exit(0);
    break;
    default:
    cout<<"Wrong Entry"<<endl;
    }
    }

    void Sub()
    {
    system("color 1d");
    cout<<"~~~~~~~~~~~~~~~You Choose Subtraction~~~~~~~~~~~~~~"<<endl<<endl;
    double a,b;
    cout<<"Enter the Value of A = ";
    cin>>a;
    cout<<"Enter the Value of B = ";
    cin>>b;
    cout<<endl;
    cout<<a<<" - "<<b<<" = "<<a-b<<endl<<endl;
    cout<<"1.For Again Subtraction"<<endl;
    cout<<"2.Back to Main Menu"<<endl;
    cout<<"3.Exit"<<endl;
    int o;
    cout<<endl;
    cout<<"~~~~~~~~~~~~~~~~~~"<<endl;
    cout<<"Enter Option = ";
    cin>>o;
    cout<<endl;
    cout<<"~~~~~~~~~~~~~~~~~~"<<endl;
    cout<<endl<<endl;
    switch(o)
    {
    case 1:
    Sub();
    break;
    case 2:
    main();
    break;
    case 3:
    exit(0);
    break;
    default:
    cout<<"Wrong Entry"<<endl;
    }
    }

    void Mul()
    {
    system("color 5e");
    cout<<"~~~~~~~~~~~~~~~You Choose Multiplication~~~~~~~~~~~~~~"<<endl<<endl;
    double a,b;
    cout<<"Enter the Value of A = ";
    cin>>a;
    cout<<"Enter the Value of B = ";
    cin>>b;
    cout<<endl;
    cout<<a<<" * "<<b<<" = "<<a*b<<endl<<endl;
    cout<<"1.For Again Multiplication"<<endl;
    cout<<"2.Back to Main Menu"<<endl;
    cout<<"3.Exit"<<endl;
    int o;
    cout<<endl;
    cout<<"~~~~~~~~~~~~~~~~~~"<<endl;
    cout<<"Enter Option = ";
    cin>>o;
    cout<<endl;
    cout<<"~~~~~~~~~~~~~~~~~~"<<endl;
    cout<<endl<<endl;
    switch(o)
    {
    case 1:
    Mul();
    break;
    case 2:
    main();
    break;
    case 3:
    exit(0);
    break;
    default:
    cout<<"Wrong Entry"<<endl;
    }
    }

    void Div()
    {
    system("color 2f");
    cout<<"~~~~~~~~~~~~~~~You Choose Division~~~~~~~~~~~~~~"<<endl<<endl;
    double a,b;
    cout<<"Enter the Value of A = ";
    cin>>a;
    cout<<"Enter the Value of B = ";
    cin>>b;
    cout<<endl;
    cout<<a<<" / "<<b<<" = "<<a/b<<endl<<endl;
    cout<<"1.For Again Division"<<endl;
    cout<<"2.Back to Main Menu"<<endl;
    cout<<"3.Exit"<<endl;
    int o;
    cout<<endl;
    cout<<"~~~~~~~~~~~~~~~~~~"<<endl;
    cout<<"Enter Option = ";
    cin>>o;
    cout<<endl;
    cout<<"~~~~~~~~~~~~~~~~~~"<<endl;
    cout<<endl<<endl;
    switch(o)
    {
    case 1:
    Div();
    break;
    case 2:
    main();
    case 3:
    exit(0);
    break;
    default:
    cout<<"Wrong Entry"<<endl;
    }
    }

    void Rem()
    {
    system("color 2b");
    cout<<"~~~~~~~~~~~~~~~You Choose Remainder~~~~~~~~~~~~~~"<<endl<<endl;
    int a,b;
    cout<<"Enter the Value of A = ";
    cin>>a;
    cout<<"Enter the Value of B = ";
    cin>>b;
    cout<<endl;
    cout<<a<<" % "<<b<<" = "<<a%b<<endl<<endl;
    cout<<"1.For Again Remainder"<<endl;
    cout<<"2.Back to Main Menu"<<endl;
    cout<<"3.Exit"<<endl;
    int o;
    cout<<endl;
    cout<<"~~~~~~~~~~~~~~~~~~"<<endl;
    cout<<"Enter Option = ";
    cin>>o;
    cout<<endl;
    cout<<"~~~~~~~~~~~~~~~~~~"<<endl;
    cout<<endl<<endl;
    switch(o)
    {
    case 1:
    Rem();
    break;
    case 2:
    main();
    break;
    case 3:
    exit(0);
    break;
    default:
    cout<<"Wrong Entry"<<endl;
    }
    }

    void Fac()
    {
    system("color 5b");
    cout<<"~~~~~~~~~~~~~~~You Choose Factorial~~~~~~~~~~~~~~"<<endl<<endl;
    int a,b,c;
    cout<<"Enter the Number = ";
    cin>>a;
    c=a;
    for(b=a-1;b>0;b--)
    a=b*a;
    cout<<endl;
    cout<<"Factorial of "<<c<<" = "<<a<<endl<<endl;
    cout<<"1.For Again Factorial"<<endl;
    cout<<"2.Back to Main Menu"<<endl;
    cout<<"3.Exit"<<endl;
    int o;
    cout<<endl;
    cout<<"~~~~~~~~~~~~~~~~~~"<<endl;
    cout<<"Enter Option = ";
    cin>>o;
    cout<<endl;
    cout<<"~~~~~~~~~~~~~~~~~~"<<endl;
    cout<<endl<<endl;
    switch(o)
    {
    case 1:
    Fac();
    break;
    case 2:
    main();
    break;
    case 3:
    exit(0);
    break;
    default:
    cout<<"Wrong Entry"<<endl;
    }

    }

    void EvOd()
    {
    system("color 6a");
    cout<<"~~~~~~~~~~~~~~~You Choose Even or Odd~~~~~~~~~~~~~~"<<endl<<endl;
    int a;
    cout<<"Enter a Number = ";
    cin>>a;
    cout<<endl;
    if(a%2==0)
    cout<<a<<" is Even "<<endl<<endl;
    else
    cout<<a<<" is Odd "<<endl<<endl;
    cout<<"1.For Again Even or Odd"<<endl;
    cout<<"2.Back to Main Menu"<<endl;
    cout<<"3.Exit"<<endl;
    int o;
    cout<<endl;
    cout<<"~~~~~~~~~~~~~~~~~~"<<endl;
    cout<<"Enter Option = ";
    cin>>o;
    cout<<endl;
    cout<<"~~~~~~~~~~~~~~~~~~"<<endl;
    cout<<endl<<endl;
    switch(o)
    {
    case 1:
    EvOd();
    break;
    case 2:
    main();
    break;
    case 3:
    exit(0);
    break;
    default:
    cout<<"Wrong Entry"<<endl;
    }
    }

    void main()
    {
    system("color 2f");
    MainMenu();
    int o;
    cout<<"Enter the Choice = ";
    cin>>o;
    cout<<endl;
    switch(o)
    {
    case 1:
    Add();
    break;
    case 2:
    Sub();
    break;
    case 3:
    Mul();
    break;
    case 4:
    Div();
    break;
    case 5:
    Rem();
    break;
    case 6:
    Fac();
    break;
    case 7:
    EvOd();
    break;
    case 8:
    exit(0);
    break;
    default :
    cout<<"Wrong Entry Plese Enter Again"<<endl<<endl;
    main();
    }
    system("pause");
    }

  2. #2
    Omer27's Avatar
    Omer27 is offline Advance Member
    Last Online
    30th January 2024 @ 04:01 PM
    Join Date
    27 Jan 2009
    Age
    31
    Posts
    1,725
    Threads
    72
    Credits
    1,374
    Thanked
    66

    Default

    Lagta Hai Kisi Ko Pasand Nahi Aaya

  3. #3
    *Xpert~Baba*'s Avatar
    *Xpert~Baba* is offline SHD38SK
    Last Online
    11th January 2018 @ 08:47 PM
    Join Date
    01 May 2010
    Location
    GHAR
    Gender
    Male
    Posts
    12,921
    Threads
    907
    Credits
    983
    Thanked
    2337

    Default

    Quote omer27 said: View Post
    آج جو پروگرام میں پوسٹ کر رہا ہوں اس سے آپ پلس ، مینس وغیرہ کر سکتے ہیں.
    اس پروگرام کو رن کریں اور بتایں کے کیسا لگا



    #include<iostream>
    using namespace std;
    void main();

    void mainmenu()
    {
    cout<<" 1.addition"<<endl;
    cout<<" 2.subtraction"<<endl;
    cout<<" 3.multiplication"<<endl;
    cout<<" 4.division"<<endl;
    cout<<" 5.remainder"<<endl;
    cout<<" 6.factorial"<<endl;
    cout<<" 7.even or odd"<<endl;
    cout<<" 8.exit"<<endl<<endl;
    cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~"<<endl;
    }

    void add()
    {
    system("color 4a");
    cout<<"~~~~~~~~~~~~~~~you choose addition~~~~~~~~~~~~~~"<<endl<<endl;
    double a,b;
    cout<<"enter the value of a = ";
    cin>>a;
    cout<<"enter the value of b = ";
    cin>>b;
    cout<<endl;
    cout<<a<<" + "<<b<<" = "<<a+b<<endl<<endl;
    cout<<"1.for again addtion"<<endl;
    cout<<"2.back to main menu"<<endl;
    cout<<"3.exit"<<endl;
    int o;
    cout<<endl;
    cout<<"~~~~~~~~~~~~~~~~~~"<<endl;
    cout<<"enter option = ";
    cin>>o;
    cout<<endl;
    cout<<"~~~~~~~~~~~~~~~~~~"<<endl;
    cout<<endl<<endl;
    switch(o)
    {
    case 1:
    Add();
    break;
    case 2:
    Main();
    break;
    case 3:
    Exit(0);
    break;
    default:
    Cout<<"wrong entry"<<endl;
    }
    }

    void sub()
    {
    system("color 1d");
    cout<<"~~~~~~~~~~~~~~~you choose subtraction~~~~~~~~~~~~~~"<<endl<<endl;
    double a,b;
    cout<<"enter the value of a = ";
    cin>>a;
    cout<<"enter the value of b = ";
    cin>>b;
    cout<<endl;
    cout<<a<<" - "<<b<<" = "<<a-b<<endl<<endl;
    cout<<"1.for again subtraction"<<endl;
    cout<<"2.back to main menu"<<endl;
    cout<<"3.exit"<<endl;
    int o;
    cout<<endl;
    cout<<"~~~~~~~~~~~~~~~~~~"<<endl;
    cout<<"enter option = ";
    cin>>o;
    cout<<endl;
    cout<<"~~~~~~~~~~~~~~~~~~"<<endl;
    cout<<endl<<endl;
    switch(o)
    {
    case 1:
    Sub();
    break;
    case 2:
    Main();
    break;
    case 3:
    Exit(0);
    break;
    default:
    Cout<<"wrong entry"<<endl;
    }
    }

    void mul()
    {
    system("color 5e");
    cout<<"~~~~~~~~~~~~~~~you choose multiplication~~~~~~~~~~~~~~"<<endl<<endl;
    double a,b;
    cout<<"enter the value of a = ";
    cin>>a;
    cout<<"enter the value of b = ";
    cin>>b;
    cout<<endl;
    cout<<a<<" * "<<b<<" = "<<a*b<<endl<<endl;
    cout<<"1.for again multiplication"<<endl;
    cout<<"2.back to main menu"<<endl;
    cout<<"3.exit"<<endl;
    int o;
    cout<<endl;
    cout<<"~~~~~~~~~~~~~~~~~~"<<endl;
    cout<<"enter option = ";
    cin>>o;
    cout<<endl;
    cout<<"~~~~~~~~~~~~~~~~~~"<<endl;
    cout<<endl<<endl;
    switch(o)
    {
    case 1:
    Mul();
    break;
    case 2:
    Main();
    break;
    case 3:
    Exit(0);
    break;
    default:
    Cout<<"wrong entry"<<endl;
    }
    }

    void div()
    {
    system("color 2f");
    cout<<"~~~~~~~~~~~~~~~you choose division~~~~~~~~~~~~~~"<<endl<<endl;
    double a,b;
    cout<<"enter the value of a = ";
    cin>>a;
    cout<<"enter the value of b = ";
    cin>>b;
    cout<<endl;
    cout<<a<<" / "<<b<<" = "<<a/b<<endl<<endl;
    cout<<"1.for again division"<<endl;
    cout<<"2.back to main menu"<<endl;
    cout<<"3.exit"<<endl;
    int o;
    cout<<endl;
    cout<<"~~~~~~~~~~~~~~~~~~"<<endl;
    cout<<"enter option = ";
    cin>>o;
    cout<<endl;
    cout<<"~~~~~~~~~~~~~~~~~~"<<endl;
    cout<<endl<<endl;
    switch(o)
    {
    case 1:
    Div();
    break;
    case 2:
    Main();
    case 3:
    Exit(0);
    break;
    default:
    Cout<<"wrong entry"<<endl;
    }
    }

    void rem()
    {
    system("color 2b");
    cout<<"~~~~~~~~~~~~~~~you choose remainder~~~~~~~~~~~~~~"<<endl<<endl;
    int a,b;
    cout<<"enter the value of a = ";
    cin>>a;
    cout<<"enter the value of b = ";
    cin>>b;
    cout<<endl;
    cout<<a<<" % "<<b<<" = "<<a%b<<endl<<endl;
    cout<<"1.for again remainder"<<endl;
    cout<<"2.back to main menu"<<endl;
    cout<<"3.exit"<<endl;
    int o;
    cout<<endl;
    cout<<"~~~~~~~~~~~~~~~~~~"<<endl;
    cout<<"enter option = ";
    cin>>o;
    cout<<endl;
    cout<<"~~~~~~~~~~~~~~~~~~"<<endl;
    cout<<endl<<endl;
    switch(o)
    {
    case 1:
    Rem();
    break;
    case 2:
    Main();
    break;
    case 3:
    Exit(0);
    break;
    default:
    Cout<<"wrong entry"<<endl;
    }
    }

    void fac()
    {
    system("color 5b");
    cout<<"~~~~~~~~~~~~~~~you choose factorial~~~~~~~~~~~~~~"<<endl<<endl;
    int a,b,c;
    cout<<"enter the number = ";
    cin>>a;
    c=a;
    for(b=a-1;b>0;b--)
    a=b*a;
    cout<<endl;
    cout<<"factorial of "<<c<<" = "<<a<<endl<<endl;
    cout<<"1.for again factorial"<<endl;
    cout<<"2.back to main menu"<<endl;
    cout<<"3.exit"<<endl;
    int o;
    cout<<endl;
    cout<<"~~~~~~~~~~~~~~~~~~"<<endl;
    cout<<"enter option = ";
    cin>>o;
    cout<<endl;
    cout<<"~~~~~~~~~~~~~~~~~~"<<endl;
    cout<<endl<<endl;
    switch(o)
    {
    case 1:
    Fac();
    break;
    case 2:
    Main();
    break;
    case 3:
    Exit(0);
    break;
    default:
    Cout<<"wrong entry"<<endl;
    }

    }

    void evod()
    {
    system("color 6a");
    cout<<"~~~~~~~~~~~~~~~you choose even or odd~~~~~~~~~~~~~~"<<endl<<endl;
    int a;
    cout<<"enter a number = ";
    cin>>a;
    cout<<endl;
    if(a%2==0)
    cout<<a<<" is even "<<endl<<endl;
    else
    cout<<a<<" is odd "<<endl<<endl;
    cout<<"1.for again even or odd"<<endl;
    cout<<"2.back to main menu"<<endl;
    cout<<"3.exit"<<endl;
    int o;
    cout<<endl;
    cout<<"~~~~~~~~~~~~~~~~~~"<<endl;
    cout<<"enter option = ";
    cin>>o;
    cout<<endl;
    cout<<"~~~~~~~~~~~~~~~~~~"<<endl;
    cout<<endl<<endl;
    switch(o)
    {
    case 1:
    Evod();
    break;
    case 2:
    Main();
    break;
    case 3:
    Exit(0);
    break;
    default:
    Cout<<"wrong entry"<<endl;
    }
    }

    void main()
    {
    system("color 2f");
    mainmenu();
    int o;
    cout<<"enter the choice = ";
    cin>>o;
    cout<<endl;
    switch(o)
    {
    case 1:
    Add();
    break;
    case 2:
    Sub();
    break;
    case 3:
    Mul();
    break;
    case 4:
    Div();
    break;
    case 5:
    Rem();
    break;
    case 6:
    Fac();
    break;
    case 7:
    Evod();
    break;
    case 8:
    Exit(0);
    break;
    default :
    Cout<<"wrong entry plese enter again"<<endl<<endl;
    main();
    }
    system("pause");
    }
    great....awesome yaar

  4. #4
    Omer27's Avatar
    Omer27 is offline Advance Member
    Last Online
    30th January 2024 @ 04:01 PM
    Join Date
    27 Jan 2009
    Age
    31
    Posts
    1,725
    Threads
    72
    Credits
    1,374
    Thanked
    66

    Default

    Thanks shd38sk Bhai.
    Abi me Kuch Dino Tak is me aur bi Functions Add Karo Ga.

  5. #5
    Omer27's Avatar
    Omer27 is offline Advance Member
    Last Online
    30th January 2024 @ 04:01 PM
    Join Date
    27 Jan 2009
    Age
    31
    Posts
    1,725
    Threads
    72
    Credits
    1,374
    Thanked
    66

    Default

    lagta hai Programing me kisi ko dilchasbi nahi.

  6. #6
    Omer27's Avatar
    Omer27 is offline Advance Member
    Last Online
    30th January 2024 @ 04:01 PM
    Join Date
    27 Jan 2009
    Age
    31
    Posts
    1,725
    Threads
    72
    Credits
    1,374
    Thanked
    66

    Default

    Mene Apne Program me Prime Number Check Karne ka Function Add kia hai.

    #include<iostream>
    using namespace std;
    void main();

    void MainMenu()
    {
    cout<<" 1.Addition"<<endl;
    cout<<" 2.Subtraction"<<endl;
    cout<<" 3.Multiplication"<<endl;
    cout<<" 4.Division"<<endl;
    cout<<" 5.Remainder"<<endl;
    cout<<" 6.Factorial"<<endl;
    cout<<" 7.Even or Odd"<<endl;
    cout<<" 8.Prime or Not"<<endl;
    cout<<" 9.Exit"<<endl<<endl;
    cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~"<<endl;
    }

    void Add()
    {
    system("color 4a");
    cout<<"~~~~~~~~~~~~~~~You Choose Addition~~~~~~~~~~~~~~"<<endl<<endl;
    double a,b;
    cout<<"Enter the Value of A = ";
    cin>>a;
    cout<<"Enter the Value of B = ";
    cin>>b;
    cout<<endl;
    cout<<a<<" + "<<b<<" = "<<a+b<<endl<<endl;
    cout<<"1.For Again Addtion"<<endl;
    cout<<"2.Back to Main Menu"<<endl;
    cout<<"3.Exit"<<endl;
    int o;
    cout<<endl;
    cout<<"~~~~~~~~~~~~~~~~~~"<<endl;
    cout<<"Enter Option = ";
    cin>>o;
    cout<<endl;
    cout<<"~~~~~~~~~~~~~~~~~~"<<endl;
    cout<<endl<<endl;
    switch(o)
    {
    case 1:
    Add();
    break;
    case 2:
    main();
    break;
    case 3:
    exit(0);
    break;
    default:
    cout<<"Wrong Entry"<<endl;
    }
    }

    void Sub()
    {
    system("color 1d");
    cout<<"~~~~~~~~~~~~~~~You Choose Subtraction~~~~~~~~~~~~~~"<<endl<<endl;
    double a,b;
    cout<<"Enter the Value of A = ";
    cin>>a;
    cout<<"Enter the Value of B = ";
    cin>>b;
    cout<<endl;
    cout<<a<<" - "<<b<<" = "<<a-b<<endl<<endl;
    cout<<"1.For Again Subtraction"<<endl;
    cout<<"2.Back to Main Menu"<<endl;
    cout<<"3.Exit"<<endl;
    int o;
    cout<<endl;
    cout<<"~~~~~~~~~~~~~~~~~~"<<endl;
    cout<<"Enter Option = ";
    cin>>o;
    cout<<endl;
    cout<<"~~~~~~~~~~~~~~~~~~"<<endl;
    cout<<endl<<endl;
    switch(o)
    {
    case 1:
    Sub();
    break;
    case 2:
    main();
    break;
    case 3:
    exit(0);
    break;
    default:
    cout<<"Wrong Entry"<<endl;
    }
    }

    void Mul()
    {
    system("color 5e");
    cout<<"~~~~~~~~~~~~~~~You Choose Multiplication~~~~~~~~~~~~~~"<<endl<<endl;
    double a,b;
    cout<<"Enter the Value of A = ";
    cin>>a;
    cout<<"Enter the Value of B = ";
    cin>>b;
    cout<<endl;
    cout<<a<<" * "<<b<<" = "<<a*b<<endl<<endl;
    cout<<"1.For Again Multiplication"<<endl;
    cout<<"2.Back to Main Menu"<<endl;
    cout<<"3.Exit"<<endl;
    int o;
    cout<<endl;
    cout<<"~~~~~~~~~~~~~~~~~~"<<endl;
    cout<<"Enter Option = ";
    cin>>o;
    cout<<endl;
    cout<<"~~~~~~~~~~~~~~~~~~"<<endl;
    cout<<endl<<endl;
    switch(o)
    {
    case 1:
    Mul();
    break;
    case 2:
    main();
    break;
    case 3:
    exit(0);
    break;
    default:
    cout<<"Wrong Entry"<<endl;
    }
    }

    void Div()
    {
    system("color 2f");
    cout<<"~~~~~~~~~~~~~~~You Choose Division~~~~~~~~~~~~~~"<<endl<<endl;
    double a,b;
    cout<<"Enter the Value of A = ";
    cin>>a;
    cout<<"Enter the Value of B = ";
    cin>>b;
    cout<<endl;
    cout<<a<<" / "<<b<<" = "<<a/b<<endl<<endl;
    cout<<"1.For Again Division"<<endl;
    cout<<"2.Back to Main Menu"<<endl;
    cout<<"3.Exit"<<endl;
    int o;
    cout<<endl;
    cout<<"~~~~~~~~~~~~~~~~~~"<<endl;
    cout<<"Enter Option = ";
    cin>>o;
    cout<<endl;
    cout<<"~~~~~~~~~~~~~~~~~~"<<endl;
    cout<<endl<<endl;
    switch(o)
    {
    case 1:
    Div();
    break;
    case 2:
    main();
    case 3:
    exit(0);
    break;
    default:
    cout<<"Wrong Entry"<<endl;
    }
    }

    void Rem()
    {
    system("color 2b");
    cout<<"~~~~~~~~~~~~~~~You Choose Remainder~~~~~~~~~~~~~~"<<endl<<endl;
    int a,b;
    cout<<"Enter the Value of A = ";
    cin>>a;
    cout<<"Enter the Value of B = ";
    cin>>b;
    cout<<endl;
    cout<<a<<" % "<<b<<" = "<<a%b<<endl<<endl;
    cout<<"1.For Again Remainder"<<endl;
    cout<<"2.Back to Main Menu"<<endl;
    cout<<"3.Exit"<<endl;
    int o;
    cout<<endl;
    cout<<"~~~~~~~~~~~~~~~~~~"<<endl;
    cout<<"Enter Option = ";
    cin>>o;
    cout<<endl;
    cout<<"~~~~~~~~~~~~~~~~~~"<<endl;
    cout<<endl<<endl;
    switch(o)
    {
    case 1:
    Rem();
    break;
    case 2:
    main();
    break;
    case 3:
    exit(0);
    break;
    default:
    cout<<"Wrong Entry"<<endl;
    }
    }

    void Fac()
    {
    system("color 5b");
    cout<<"~~~~~~~~~~~~~~~You Choose Factorial~~~~~~~~~~~~~~"<<endl<<endl;
    int a,b,c;
    cout<<"Enter the Number = ";
    cin>>a;
    c=a;
    for(b=a-1;b>0;b--)
    a=b*a;
    cout<<endl;
    cout<<"Factorial of "<<c<<" = "<<a<<endl<<endl;
    cout<<"1.For Again Factorial"<<endl;
    cout<<"2.Back to Main Menu"<<endl;
    cout<<"3.Exit"<<endl;
    int o;
    cout<<endl;
    cout<<"~~~~~~~~~~~~~~~~~~"<<endl;
    cout<<"Enter Option = ";
    cin>>o;
    cout<<endl;
    cout<<"~~~~~~~~~~~~~~~~~~"<<endl;
    cout<<endl<<endl;
    switch(o)
    {
    case 1:
    Fac();
    break;
    case 2:
    main();
    break;
    case 3:
    exit(0);
    break;
    default:
    cout<<"Wrong Entry"<<endl;
    }

    }

    void EvOd()
    {
    system("color 6a");
    cout<<"~~~~~~~~~~~~~~~You Choose Even or Odd~~~~~~~~~~~~~~"<<endl<<endl;
    int a;
    cout<<"Enter a Number = ";
    cin>>a;
    cout<<endl;
    if(a%2==0)
    cout<<a<<" is Even "<<endl<<endl;
    else
    cout<<a<<" is Odd "<<endl<<endl;
    cout<<"1.For Again Even or Odd"<<endl;
    cout<<"2.Back to Main Menu"<<endl;
    cout<<"3.Exit"<<endl;
    int o;
    cout<<endl;
    cout<<"~~~~~~~~~~~~~~~~~~"<<endl;
    cout<<"Enter Option = ";
    cin>>o;
    cout<<endl;
    cout<<"~~~~~~~~~~~~~~~~~~"<<endl;
    cout<<endl<<endl;
    switch(o)
    {
    case 1:
    EvOd();
    break;
    case 2:
    main();
    break;
    case 3:
    exit(0);
    break;
    default:
    cout<<"Wrong Entry"<<endl;
    }
    }

    void Pri()
    {
    system("color 6a");
    cout<<"~~~~~~~~~~~~~~~You Choose Prime or Not Prime~~~~~~~~~~~~~~"<<endl<<endl;
    int a,b,c=0;
    cout<<"Enter a Number = ";
    cin>>a;
    cout<<endl;
    for(b=2;b<a;b++)
    if(a%b==0)
    c=c+1;

    if(c==0)
    cout<<a<<" is Prime "<<endl<<endl;
    else
    cout<<a<<" is Not Prime"<<endl<<endl;

    cout<<"1.For Again Prime or Not Prime"<<endl;
    cout<<"2.Back to Main Menu"<<endl;
    cout<<"3.Exit"<<endl;
    int o;
    cout<<endl;
    cout<<"~~~~~~~~~~~~~~~~~~"<<endl;
    cout<<"Enter Option = ";
    cin>>o;
    cout<<endl;
    cout<<"~~~~~~~~~~~~~~~~~~"<<endl;
    cout<<endl<<endl;
    switch(o)
    {
    case 1:
    Pri();
    break;
    case 2:
    main();
    break;
    case 3:
    exit(0);
    break;
    default:
    cout<<"Wrong Entry"<<endl;
    }
    }

    void main()
    {
    system("color 2f");
    MainMenu();
    int o;
    cout<<"Enter the Choice = ";
    cin>>o;
    cout<<endl;
    switch(o)
    {
    case 1:
    Add();
    break;
    case 2:
    Sub();
    break;
    case 3:
    Mul();
    break;
    case 4:
    Div();
    break;
    case 5:
    Rem();
    break;
    case 6:
    Fac();
    break;
    case 7:
    EvOd();
    break;
    case 8:
    Pri();
    break;
    case 9:
    exit(0);
    break;
    default :
    cout<<"Wrong Entry Plese Enter Again"<<endl<<endl;
    main();
    }
    system("pause");
    }

  7. #7
    yasir81 is offline Junior Member
    Last Online
    10th October 2017 @ 01:49 PM
    Join Date
    10 May 2011
    Age
    33
    Gender
    Male
    Posts
    3
    Threads
    0
    Credits
    816
    Thanked
    0

    Default

    bhai jan programing mai dilchasnp hai per plz agar start se listen by listen post kare to sekne mai b mazay ayega aur daikne mai b

  8. #8
    justali's Avatar
    justali is offline Senior Member+
    Last Online
    21st February 2023 @ 03:10 PM
    Join Date
    11 Dec 2010
    Location
    Karachi
    Age
    37
    Gender
    Male
    Posts
    282
    Threads
    37
    Credits
    1,195
    Thanked
    23

    Default

    chalana kese hai bahi is ko..............

  9. #9
    Omer27's Avatar
    Omer27 is offline Advance Member
    Last Online
    30th January 2024 @ 04:01 PM
    Join Date
    27 Jan 2009
    Age
    31
    Posts
    1,725
    Threads
    72
    Credits
    1,374
    Thanked
    66

    Default

    Sirf Copy aur Paste karo kisi bi compiler me.mene ye visual c++ 2010 me banaya hai.

  10. #10
    Omer27's Avatar
    Omer27 is offline Advance Member
    Last Online
    30th January 2024 @ 04:01 PM
    Join Date
    27 Jan 2009
    Age
    31
    Posts
    1,725
    Threads
    72
    Credits
    1,374
    Thanked
    66

    Default

    Quote yasir81 said: View Post
    bhai jan programing mai dilchasnp hai per plz agar start se listen by listen post kare to sekne mai b mazay ayega aur daikne mai b
    ye program jitna lamba hai utna hi asan hai.bus aap aik baar read kar le.
    wese aap ko me thora bohat bata deta hon.
    ye aik menu driven program hai.mene is me bohat sare functions banaye hai.
    har function ka alag alag kaam hai.
    main function me mene pehle mainmenu function ko call kia hai.
    mainmenu function me sare functions ki detail hai.
    user jo karna chahta hai us lihaz se button press kare phir wo function call ho
    jai ga jo us ne button press kia hoga.phir isi tarah functions ke ander
    bi bohat c cheze hain.
    agar koi cheez samjh na aaye tu pooch le.

  11. #11
    asjadkhuram's Avatar
    asjadkhuram is offline Senior Member+
    Last Online
    13th December 2019 @ 12:23 PM
    Join Date
    30 Jun 2010
    Location
    Lahore
    Age
    36
    Gender
    Male
    Posts
    49
    Threads
    0
    Credits
    1,320
    Thanked
    2

    Default

    very good but complement

  12. #12
    Omer27's Avatar
    Omer27 is offline Advance Member
    Last Online
    30th January 2024 @ 04:01 PM
    Join Date
    27 Jan 2009
    Age
    31
    Posts
    1,725
    Threads
    72
    Credits
    1,374
    Thanked
    66

    Default

    Quote asjadkhuram said: View Post
    very good but complement
    Shukriya Pasand Karne Ka.

Page 1 of 9 1234 ... LastLast

Similar Threads

  1. Write a C++ program to MAke Simple calculator
    By MoqaddasAli in forum C++
    Replies: 7
    Last Post: 2nd January 2016, 06:51 AM
  2. Replies: 5
    Last Post: 14th August 2014, 02:30 AM
  3. Maths
    By Hassanraza88 in forum 10th
    Replies: 5
    Last Post: 10th March 2014, 12:34 PM
  4. Solved Maths
    By m_jon in forum Solved Problem (Education)
    Replies: 6
    Last Post: 17th January 2011, 12:31 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
  •