Hello !!
Create an algorithm for calculate porcentage in C language.
Thank you !
Answers
Answer:
hey mate here is Ur answer ...
c language means that ...
Algorithm
Algorithm to find percentage is as follows −
START
Step 1 → Collect values for part and total
Step 2 → Apply formula { percentage = ( part / total ) × 100 }
Step 3 → Display percentage
STOP
Pseudocode
Pseudocode for the algorithm can be written as −
procedure percentage()
VAR value, total
percentage = value / total * 100
RETURN percentage
end procedure
Implementation
Implementation of this algorithm is given below −
Live Demo
int main() {
float percentage;
int total_marks = 1200;
int scored = 1122;
percentage = (float)scored / total_marks * 100.0;
printf("Percentage = %.2f%%", percentage);
return 0;
}
Output
Output of the program should be −
Percentage = 93.50%
hope you are interested in
Answer:
hey mate here is Ur answer ...
c language means that ...
Algorithm
Algorithm to find percentage is as follows −
START
Step 1 → Collect values for part and total
Step 2 → Apply formula { percentage = ( part / total ) × 100 }
Step 3 → Display percentage
STOP
Pseudocode
Pseudocode for the algorithm can be written as −
procedure percentage()
VAR value, total
percentage = value / total * 100
RETURN percentage
end procedure
Implementation
Implementation of this algorithm is given below −
Live Demo
int main() {
float percentage;
int total_marks = 1200;
int scored = 1122;
percentage = (float)scored / total_marks * 100.0;
printf("Percentage = %.2f%%", percentage);
return 0;
}
Output
Output of the program should be −
Percentage = 93.50%
hope you are interested in