Postagens

Course C Initial 9th – If-else Selection Command.

Imagem
Lesson 9. Note: for this lesson or the next, you need of all saw up to here. With all that we saw up to here, we can go on to an important thing when we’re programming. How can I use conditions in my code? Well, maybe I don’t run the code fully, so, what can I make? To answer those questions is that I present to you the study about Selections Commands in C language. There’s two selections commands in C, if-else and switch, we’ll see both. But now, we’ll see if-else. First understand the structure: if (condition is true) { #commands } Can you understand? The if command verified if the condition is true, if it’s, so run, else run other command if it there. Analyze the condition below: Else is for the moment that if is false. In some case, problems can be solved with else, it cans economize data. Make an algorithm that test 3 numbers typed by user and print the greater. For the test, will be used logical comman...

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 ...

Course C Initial – 5th Backslash Commands

Imagem
This is a short lesson, below you’ll can see a table with some commands with backslash. They’ll be used to organized the codes, back here always that you need. Well, that’s all folks! In the next lesson, we’ll see the mathematical functions in C language. See you later folks!

Course C Initial – 4th First Exercises

Imagem
Now, as promised in previous lesson, here are some questions to you made: Make an Algorithm that print I’m fine at display. Make an Algorithm that store a number to a variable and print it at display. Make an Algorithm that reserves a number and a letter and print them at display. Make an Algorithm that reserves an integer and a floating and print them. Make an Algorithm and inside, create a float variable called Number that stored the number 7.596, after print it with only one decimal house. Make these algorithms, practice because this will help you to learn more and better. Below you can make download of their: Question 1   Question 2 Question 3   Question 4 Question 5 Well, that's all folks! In the next lesson, we'll see othres important commands! Share with your friends! See you later!

Course C Initial – 3rd Variables Part. 2

Imagem
Lesson 3 Part. 2 . Now, as promised, I present for you the last part of variables. In this lesson, we’ll learn to store a variable with the commands in the language. Well, let’s go so. First, see the C program structure below: In this code, we can see that it ask to user type a number, so after, we see ‘scanf’ this is the command to read and stored to a variable in C. Between parentheses, we have a control string ‘%i’, after the ‘&’ symbol and the variable name. So, scanf structure is: scanf(“%control_string”,&variable_name); below, see this table with some data types control strings. Now, we can see create codes with this knowledge. Test them in your compiler because the practice is the way to learn and be a programmer. So, copy this code in your compiler: This algorithm ask the user’s tall and print it. Write this algorithm in your compiler and test how many times you want....