วันอาทิตย์, มิถุนายน 1, 2025
Latest:
วิชาภาษาจาวา (java)

ตัวดำเนินการทางคณิตศาสตร์ ภาษาจาวา (java)

ตัวดำเนินการทางคณิตศาสตร์นั้นเราสามารถเรียกมาใช้ง่ายได้อย่างง่าย ด้วยการเรียกใช้งานสัญลักษณ์ตัวดำเนินการคณิตศาสตร์ โดยสามารถเลือกการทำในคำสั่ง print หรือเราจะใส่ในส่วนของตัวแปรก็ได้ ทั้งนี้ทั้งนั้นขึ้นอยู่กับผู้เขียนโปรแกรมเอง

ตัวดำเนินการทางคณิตศาสตร์

+  คือการบวก

– คือการลบ

* คือการคูณ

/ คือการหาร

% คือหารเอาเศษ

 

class Printtestmath 
{
	public static void main(String[] args) 
	{
		int a = 10;
		int b = 10;
		int c = 10;
		System.out.println(a+b);
		System.out.println(a-c);
		System.out.println(a*b);
		System.out.println(a/b);
		System.out.println(a%b);
	}
}
slot gacor hari ini slot qris slot gacor maxwin slot online slot gacor gampang menang slot gacor hari ini slot online slot slot slot guci777 wortel21 guci777 guci777 wortel21 wortel21 wortel21