Write a Java program to round up the result of integer division

Write a Java program to round up the result of integer division


Introduction

In this demo I have used NetBeans IDE 8.2 for debugging purpose. But you can use any java programming language compiler as per your availability..


techstudy.org

Kindle Paperwhite High Resolution Display Tablet | Rs. 9999

  1. import java.util.*;
  2. public class Javamathexcercise {
  3.  
  4. public static void main(String[] args) {
  5.  
  6. int total_therotical_marks = 450, total_practical_marks = 90, total_marks = 600;
  7. int percentage_of_marks = ((total_therotical_marks + total_practical_marks)*100)/total_marks;
  8.  
  9. System.out.print("\nPercentage of Marks: "+percentage_of_marks+"%\n");
  10.  
  11. }
  12. }

Result

java techstudy.org

     





Related Topics


Responses




Popular Posts

Facebook

Founded in 2016, Tech Study passionately delivers stylish and dynamic innovative information to programmer and technology lovers. http://www.techstudy.org/.