Professional Documents
Culture Documents
TOPIC OF EXPERIMENT-
A cube having a side of 6 cm is painted red on all the faces and then cut into smaller
cubes of 1 cm each. Write a program to find the total number of smaller cubes so
obtained.
AIM OF THE
EXPERIMENT-
FLOWCHART/ ALGORITHM-
1. START
2. #include <stdio.h>
5. Assign values
6. Print C
7. STOP
#include <stdio.h>
int main()
int side_of_cube,cut_into,new_side,number_of_cubes;
scanf("%d",&side_of_cube);
scanf("%d",&cut_into);
new_side=side_of_cube/cut_into;
number_of_cubes=new_side*new_side*new_side;
printf("%d",number_of_cubes);
return 0;
}
1. Syntax errors: errors due to the fact that the syntax of the language is not
respected (6 times).
2. Semantic errors: errors due to an improper use of program statements (1time).
3. Logical errors: errors due to the fact that the specification is not respected (2
times).
4. Compile time errors: syntax errors and static semantic errors indicated by the
compiler (7 times).
LEARNING OUTCOMES-
Learned how to perform input and output operations.
Learned how to get mathematical solutions.
Learned to use integer functions.
4. Total Marks 30