Square root and power functions (C++ programming tutorial)

Поделиться
HTML-код
  • Опубликовано: 24 янв 2025

Комментарии • 61

  • @Engineer4Free
    @Engineer4Free  12 лет назад +1

    I use Xcode 3. If you are using the same program you can select "view > message bubbles > all issues" from the top menu and they will be displayed. If you are using a different program you should look through its view menu (or something similar) and try to find something about displaying messages.

  • @toxicwall6593
    @toxicwall6593 2 года назад +1

    Thx a lot this was way easier than the other tutorials ive seen

  • @syedarimshakazmi5622
    @syedarimshakazmi5622 3 года назад +4

    Thanks a lot ur vid literally helped me

    • @Engineer4Free
      @Engineer4Free  3 года назад +3

      Glad to hear it! There is more at engineer4free.com/cplusplus =)

  • @moniramohazabin7895
    @moniramohazabin7895 4 года назад +2

    Thank for your tutorial

  • @Engineer4Free
    @Engineer4Free  11 лет назад +2

    glad to hear it!

  • @mrryanbond007
    @mrryanbond007 5 лет назад +2

    thx very helpful, never thought that it only required a new header

  • @veejj6843
    @veejj6843 9 лет назад +1

    But what if that number that you are square rooting is a variable, regardless if its an integer or not, and you want to continue to use the square rooted number with more addition before showing it on screen? I am trying to make a C++ program for finding the Surface Area of a Cone and I have to continue to use the number after it is square rooted. Any help?

  • @MrComonroots99
    @MrComonroots99 12 лет назад +1

    How do you get the options to pop up after you double click the cmd (pow,sqrt, etc) with the open brackets "double"? I dont get open brackets when I type pow or sqrt.

  • @guitarttimman
    @guitarttimman 6 лет назад +1

    Can you put i++ for square?

  • @murtazaiqbal9444
    @murtazaiqbal9444 9 лет назад +3

    Thank you man it erally helped me in my work

    • @Engineer4Free
      @Engineer4Free  9 лет назад

      +Murtaza Iqbal Always happy to hear when people are finding my videos helpful! Feel free to check out all the C++ tutorials I've made so far here: www.engineer4free.com/cplusplus :)

  • @0xS7
    @0xS7 6 лет назад +1

    Can someone tell me what program he's using ?

  • @Engineer4Free
    @Engineer4Free  11 лет назад

    RUclips wont let me write proper code in the comments, so here is what you can write (minus the semicolons)
    double x
    cout

  • @barewr828
    @barewr828 6 лет назад +2

    What editor are you using?

    • @Engineer4Free
      @Engineer4Free  6 лет назад

      Xcode. You can find all the hardware and software that I use at engineer4free.com/tools

  • @jannahmae4194
    @jannahmae4194 4 года назад +1

    what is the difference between math.h and cmath? First year computer science student here.

    • @Engineer4Free
      @Engineer4Free  4 года назад

      Mmmm, here's a good response to that question from StackOverflow: stackoverflow.com/a/15656459

  • @austinedeclan10
    @austinedeclan10 7 лет назад +2

    I had no idea I had to include cmath. That's what was missing for me. First year computer science student here.

    • @Engineer4Free
      @Engineer4Free  7 лет назад

      Glad I can help! I remember learning C++ in my first year and the stupidest/tiniest things that I just didn't know to look for would hold me up for hours. If you haven't already, make sure you check out engineer4free.com/cplusplus for the rest of the videos!

    • @austinedeclan10
      @austinedeclan10 7 лет назад

      Engineer4Free thanks a lot man.

  • @potato6151
    @potato6151 7 лет назад +1

    What text editor are you using? I'm just using the C++ software because I can't seem to run C++ on Brackets

    • @Engineer4Free
      @Engineer4Free  7 лет назад +1

      It's an older version of Xcode. Here's a good list of alternatives to it too: alternativeto.net/software/xcode/

  • @melissasumer
    @melissasumer Год назад

    (X^3/ sqrt x ^2 ) x+2 there was a question like this not exactly the same but how we can do it?

  • @alexranos4212
    @alexranos4212 11 лет назад +1

    many thanks u helped me a lot

  • @MrComonroots99
    @MrComonroots99 12 лет назад +2

    Great, thanks for the info

  • @icebergmike27
    @icebergmike27 10 лет назад +1

    what if the input for square root is a negative number? I keep getting nan

    • @victorFT10000
      @victorFT10000 10 лет назад

      to do the square of a negative number you need to do for ex: square of -25 ou need to separete square of -1 x square of 25 now make the square of 25 and now is square of -1 x 5 they discovered that the square of -1 is i, i is a imaginary number so the answer to the square of -25 is 5i

  • @bijansanchez3804
    @bijansanchez3804 10 лет назад +2

    what if the base is negative and the power is 0.5???

    • @the_jingo
      @the_jingo 6 лет назад +1

      Square root mean power is 2

  • @sonicm1997
    @sonicm1997 9 лет назад +1

    thank you very much

  • @DarkNight-zc7se
    @DarkNight-zc7se 5 лет назад +1

    How to do the cube root????

    • @Engineer4Free
      @Engineer4Free  5 лет назад +1

      You could code your own function, similar to this one: www.engineer4free.com/4/how-to-build-your-own-power-function-from-scratch

    • @DarkNight-zc7se
      @DarkNight-zc7se 5 лет назад

      @@Engineer4Free Thanks

  • @veritasthepotato
    @veritasthepotato 7 лет назад

    what IDE do you recommend for C++ coding on a mac? I am using Xcode but tbh it sucks :/

    • @Engineer4Free
      @Engineer4Free  7 лет назад +1

      Here's a pretty good list of alternatives to Xcode. You can filter by platform too: alternativeto.net/software/xcode/

  • @BONJABONJA
    @BONJABONJA 9 лет назад

    I have got a problem, when I try to calculate a square root, if the result contains decimals, It shows me the closest number, and not the result with decimals

    • @Engineer4Free
      @Engineer4Free  9 лет назад

      BonjaVUGM That is very strange. See how it's prompting me to enter a double? It also returns a double. I just tried mine out, if I cout

    • @BONJABONJA
      @BONJABONJA 9 лет назад

      Engineer4Free yes I'm using #include and writting the exact same thing you are writting :/

    • @rayzecor
      @rayzecor 9 лет назад

      BonjaVUGM Maybe you are using different engines.

    • @startup_cult
      @startup_cult 9 лет назад

      +BonjaVUGM declare the variable in float

    • @serifsamate
      @serifsamate 9 лет назад

      +BonjaVUGM might be you need to specify your precision. Try this in your program, right before you cout line:
      cout.setf(ios::fixed);cout.setf(ios::showpoint);cout.precision(4);

  • @whatislyf
    @whatislyf 7 лет назад +1

    Thanks alot man, that helped alot :)

    • @Engineer4Free
      @Engineer4Free  7 лет назад +1

      Thanks for commenting, glad to hear it!

  • @ahmedshaikh7662
    @ahmedshaikh7662 8 лет назад +1

    Thanks!

  • @mihneanitu4153
    @mihneanitu4153 2 года назад

    good video

  • @uzeirdalip9499
    @uzeirdalip9499 6 лет назад +1

    thanks

  • @tahasatti2375
    @tahasatti2375 6 лет назад +1

    thanks bro

  • @krabbypatty3644
    @krabbypatty3644 10 лет назад

    thank you

  • @sriharivaila7276
    @sriharivaila7276 6 лет назад

    Hello mine is not doing square root for numbers which are declared in variables

  • @sskiller7217
    @sskiller7217 6 лет назад

    grazie

  • @ah9337
    @ah9337 3 года назад +1

    Thank you so much

  • @habaa6839
    @habaa6839 5 лет назад +1

    thx so much

  • @nourelmalky8469
    @nourelmalky8469 6 лет назад

    thanks