Postagens

Mostrando postagens com o rótulo Math

Course C Initial 8th – Oder of Operations in Math.

Imagem
Lesson 8. Now, we’ll speak about math priority operators. For it, answer those questions. 1- Who will be first ran in this expression: 7+8/2x5= ? 2- What’s the result of 27+3x9=? 3- What’s the result of 7x25/5=? 4- What’s the result of -855+256-8524-5+8524=? 5- What’s the result of 7x(85*2/5)+89-4/2=? Just it. Below are the answers. Question 1: 27. Question 2: 54. Question 3: 35. Question 4: -604. Question 5: 325. This expressions is for show to you that there’s differences between math operators priority. Below, you’ll see a table which explain it. So, make this algorithms, if you need help, access the previous lessons, they could help you. So, let's go! Make an algorithm that sum a square root with a number typed by user, this number will be divided by 2 and summed with 4 multiplied by 2 and sum with square 7, so store in a variable. So, show at display. Make this algorithm, so, if you wished, make ...

Course C Initial 7th – Training with Math

Imagem
Lesson 7. Now, as promised in previous lesson, we’ll go to make some algorithms to practice all knowledge that we learned up to here. First: Make an algorithm that reserves 3 numbers by user and sum them, after show the result. For this, we first make the structure as showed below. How we can see, this is the basic structure of a software in C language. Now, we’ll create the variables for it: Okay, the variables was created. Now we’ll input the values for them with printf’s and scanf’s how you can see below: Note: always use return 0; in the end function. Now we’ll create a new variable called Result that will be the sum of Num1, Num2 and Num3 how you can see below. After we’ll print Result. That’s finished, we have an algorithm that calculates the sum between 3 numbers. Now, practice this algorithm, write and test yourself, test it change the math operators and joyful. You cou...

Course C Initial 6th – Math Functions and Operators

Imagem
Lesson 6. Now we’ll see more about the math commands in C language. In some cases, they’re different. Below, we can see a table with the math functions, firs the simple operators, after we’ll see more. Now, I present to you other thing that can help you to solve problems. I present the math library. In C, it cans be used with this structure: First we include it: #include <math.h> Note: in this case, will be used two functions that is in math library, the pow and the sqrt. Pow – it’s for Exponentiation. Sqrt – it’s for Square Root. So, First show an algorithm that use the pow function: In the display: Now a code that calculates Square Root: In the display: I remember that is need you practice. Make this algorithms and practice always because this will help you to become each moment better than before. In the next lesson, we will make algorithms with all that was saw up to here. Well, that’s ...