C++ console calculator program 🖩

Sdílet
Vložit
  • čas přidán 10. 09. 2024
  • #calculator #console #program
    Calculator console program C++

Komentáře • 29

  • @BroCodez
    @BroCodez  Před 2 lety +13

    # include
    int main() {
    char op;
    double num1;
    double num2;
    double result;
    std::cout op;
    std::cout > num1;
    std::cout > num2;
    switch(op){
    case '+':
    result = num1 + num2;
    std::cout

    • @Adoof_3.0
      @Adoof_3.0 Před 2 lety

      Thanks

    • @hardikg
      @hardikg Před 2 lety

      Hey Bro! Why this video appears to be unlisted? Any issue with the content or a mistake?
      Really Love your tutorials! Amazing!

    • @jibob6959
      @jibob6959 Před rokem

      thank you

    • @KingHypercone
      @KingHypercone Před rokem

      How to copy??????????????????????????????????????????????

  • @rayjohndimasangal775
    @rayjohndimasangal775 Před rokem +5

    tried doing the calculator first before watching the vid
    #include
    using namespace std;
    int main() {
    double a;
    double b;
    char operation;
    cout > a;
    cout > b;
    cout > operation;
    switch (operation) {
    case '+':
    cout

  • @arokurdi3848
    @arokurdi3848 Před 26 dny +1

    والله بەتەڵ بژی 🎉

  • @AniReactz
    @AniReactz Před rokem +1

    #include
    int main() {
    double x;
    double y;
    int choice;
    std::cout > x;
    std::cout > y;
    std::cout

  • @shadowfall1700
    @shadowfall1700 Před rokem +3

    thanks for teaching me C++ you're a king

  • @sgamb2985
    @sgamb2985 Před rokem +2

    Random comment:: I've been finding bro code is the best way to learn new programming languages. Thanks for the awesome vids!

  • @tanvirsahrierjishan778
    @tanvirsahrierjishan778 Před 2 měsíci

    i used if for fast and also did great and your is the fastest

  • @yellowhellow-wi9gi
    @yellowhellow-wi9gi Před měsícem

    thank you

  • @data_science_uzbekistan
    @data_science_uzbekistan Před 9 měsíci

    that's awesome bro. Now I will tel you 1 thing. when num1 is divided by num2, and num1 is equal to 4 and num2 is equal to 0. in the end answer will be infinity right ?

    • @LSDStudiosParahill
      @LSDStudiosParahill Před měsícem

      My clumsy way of solving it:
      case '*':
      result = num1 * num2;
      if (num1 == 0){
      result = 0;
      }
      if (num2 == 0){
      result = 0;
      }
      std::cout

  • @vmook655
    @vmook655 Před 4 měsíci +1

    Did this before watching the video:
    #include
    #include
    int main() {
    char selectedOperator;
    double a;
    double b;
    double result;
    std::cout a;
    std::cout selectedOperator;
    std::cout b;
    switch (selectedOperator)
    {
    case '+':
    result = a + b;
    break;
    case '-':
    result = a - b;
    break;
    case '*':
    result = a * b;
    break;
    case '/':
    result = a / b;
    break;
    default:
    break;
    }
    std::cout

  • @AhmedMohamedP
    @AhmedMohamedP Před 2 lety +3

    why 'op' was a char not a string?

    • @raiden542
      @raiden542 Před 2 lety +2

      because its one caracter

    • @raiden542
      @raiden542 Před 2 lety +5

      and because switches dont work with stings

  • @FrederikWollert
    @FrederikWollert Před 5 měsíci

    Nice Video.

  • @zabiullahsafdari-to8zw
    @zabiullahsafdari-to8zw Před 8 měsíci

  • @Zeroonezero527
    @Zeroonezero527 Před rokem

    Can you imagine if user just type: "4-2" and your program find a char operator in string and calculate result..

  • @wttcs-_-9451
    @wttcs-_-9451 Před 3 měsíci

    std::cout

  • @logicalspaghetti
    @logicalspaghetti Před rokem

    spaghetti

  • @karhez163
    @karhez163 Před 2 lety

    Random comment

  • @worstDevYT
    @worstDevYT Před 4 měsíci

    abi ezik misin switchin dışına yazsana