Now that I have learned to write codes for regular variables such as sentences and words, I have now learned to write codes for numerical variables using the symbol %s or %d to appear with us in this image.
If I want to make the object in scratch say, for example, hallo world. Now I have input, which is hallo world, and output, which is the final output, which is to make the object say hallo world. But we are missing an algorithm, which is the method or command that we will give to the object to say hallo world. Of course, first we must bring a command from Events , which makes the rest of the commands work, and then to Looks, from which we will fetch the Say command and put them together to appear in this image. The say command here is the algorithm by which I was able to reach the result.
Conditionals Today I learned one of the most important programming concepts, which is conditions. The conditions we use in normal life are exactly the ones we use in programming, for example when a mother says to her son, “If you finish your homework, I will allow you to play.” Now I want to do something, but this order can only be executed under a certain condition. If it is met, the order will be executed. If it is not fulfilled, it will not be executed. This is done through the Control field and then bringing the if command. But before anything else, the forever command must be shared with us so that the computer always receives the condition and does not stop at a specific moment. Example: If the mouse touches the object, it will meow. We will write the commands like this:
Now I have tried making a program that asks me my name and when I tell it, it welcomes me. I did it before in scratch. I used to do it through the ask command. So I will do the same thing to you in C language, so I wrote the codes in this image:
Comments
Post a Comment