Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
1.3 kB
29
Indexable
Never
package lab;

public class OperaterArithmatic {
	public static void main(String[] args) {
		int x = 14; 
		int y = 8; 
		int result1 = x + y; 
		int result2 = x - y;  
		int result3 = x * y; 
		int result4 = x / y;  
		int result5 = x % y;  
		int result6 = -y + x;  
		int result7 = --y; 
		int result8 = ++x;  
		
		double a = 8.5; 
		double b = 3.4; 
		double result9 = a + b; 
		double result10 = a - b;  
		double result11 = a * b;  
		double result12 = a / b;  
		double result13 = a % b;  
		double result14 = -a + b;  
		double result15 = --a;  
		double result16 = ++b;   
		
		char letter1 = 'C'; 
		char letter2 = ++letter1;
		
		System.out.println(result1); 
		System.out.println(result2); 
		System.out.println(result3); 
		System.out.println(result4); 
		System.out.println(result5); 
		System.out.println(result6); 
		System.out.println(result7); 
		System.out.println(result8); 
		System.out.println(result9); 
		System.out.println(result10); 
		System.out.println(result11); 
		System.out.println(result12); 
		System.out.println(result13); 
		System.out.println(result14); 
		System.out.println(result15); 
		System.out.println(result16); 
		System.out.println(letter1); 
		System.out.println(letter2); 
	}
}