Professional Documents
Culture Documents
INTRODUCTION
A. Background
1. Time/Place
This practicum will be held on Friday,May 28 May 2023,at 13:00 WITA .Located
in the Computer Laboratory ,Deoartment of Physics ,Faculty of Mathematics and
Natural science ,Makassar State University.
2. Implementation
In C, the if function has codes that have meaning alone. The following is an
explanation of the meaning of each code in the inner if function C language:
a. condition`: Represents an expression or statement that evaluates as true (non-
zero) or false (zero). If the condition evaluates to true, then the code block is
in in if will be executed. If the condition evaluates to false, then the code
block is inside else (optional) will be executed.
b. `// Block of code that is executed if the condition is true (True)`: Is part of
code to be executed if the condition in if evaluates to true. Code block these
should be enclosed in curly brackets `{}` to indicate the code block boundary
the.
c. `// Block of code that is executed if the condition is false (False)`: Is part of
code to be executed if the condition in if evaluates to false. Code block these
must also be enclosed in curly braces `{}` and are optional, meaning can be
removed if not needed.It should be noted that in C language, conditions are
evaluated in the if function must return a boolean value (0 for false, non-zero
for true). If the condition is an expression, then the evaluation result will be
considered as conditions checked.
For example, if you have the condition `x > 5`, then if the value of `x` is greater
than 5, the condition will evaluate to true and the code block in the if will be
executed. If the condition is false, the code block in else (if any) is executed. Ensure
to line up code blocks properly and provide curly braces appropriate to denote the
boundary of the block of code to be executed.
3. Working Principle
In calculating the volume of a geometric shape with the if function in C, the
principle Work generally involves the following steps:
a. Variable declaration: Declare the variables needed to store length, width,
height, and volume values.
b. Enter values: Use user input or initialize the values of these variables
c. If function to calculate volume: Use if-else structure to check types of
geometric figures and calculate their volume based on the existing variables.
d. Calculation result output: Use printf to display wake volume space for users.
CHAPTER IV
RESULTS AND DISCUSSION
A. Programming Results
1. Activity 1: Calculating the volume of a geometric shape (cube)
a. Program screenshots
b. Results Program
B. Data Analysis and Interpretation
Is known :
Length = 52
Width = 17
Height = 20
Wanted : Volume of the block
Settlement
V=pxlxt
V = 52 x 17 x 20
V = 17,680
So if the length of the block is 52, the width of the block is 17 and the height
C. Discussion
The above analysis includes the calculation of beam volume based on length,
given width and height. The following is an explanation of the analysis along with an
explanation in C language:
1. In this analysis, information about length, width, and height is given beam.
The length of the block is 52, the width of the block is 17, and the height of
the block is 20.
2. The purpose of the analysis is to find the volume of the beam based on the
data given.
3. Completion of the analysis is carried out using the volume formula of the
beam, i.e. V = length × width × height.
Using the `=` operator to initialize the `length` variable, `width`, and
`height` with the given values.
Using the `*` operator to multiply the variables `length`, `width`, and
`height` to get the volume value.
In the code above, the values for length, width, and height are assigned
arbitrarily directly through variable initialization. Then, the formula for the volume of
a `long* width * height` is used to calculate the volume. The volume result is
displayed using the `printf` function. There is an error in the program, this is due to
an error in the practice in writing programs that involve the use of the percent sign
(%), semicolon (;), and curly braces ({}) in the C if function, this can cause syntax
problems, logic, or changes in behavior program.
CHAPTER V
CLOSING
A. Conclusion
Based on computer programming experiments that have been done the following
conclusions are obtained:
1. Based on the practicum that has been done to make a program calculating
wake-up space with the IF function can use the formula find the volume of the
block. The function accepts three arguments: Length, width and high. Then,
inside the main function, the user is prompted to Enter length, width and
height values using scanf. After that, we call the calculate volume shape
function with the value yang input and store the result in variable volume.
Finally, us print the volume of the block using printf.
B. Suggestion
Based on computer programming experiments that have been done, I I will give
suggestions that are constructive, namely: Practitioners can understand the practicum
material well, practice programming a lot, and also understand the meaning of the
symbols and also the signs used in programming so that the practicum can run
smooth and optimal. expected and continue to guide and pay attention Practitioners at
the time the practicum takes place For laboratory assistants, it is expected to provide a
ready-to-use computer.
BIBLIOGRAPHY
DEEPUBLISH PUBLISHERS