Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package javaapplication6;
- public class JavaApplication6 {
- public static void main(String[] args) {
- /* zad 2
- int b =42;
- System.out.println(b & 4);
- */
- /* zad 1
- int a = 765;
- System.out.println("Third digit: "+ a%10);
- System.out.println("Second digit: "+ a/10%10);
- System.out.println("First digit: " + a/100);
- */
- /* zad 3
- int num;
- num = 254;
- System.out.println (num = num >200 ? num - 100 : num + 50);
- */
- /* zad 4
- double C = 4;
- double F = 16;
- F = C * (9.0/5) +32;
- System.out.println(F);
- C = (5.0/9) * (F - 32);
- System.out.println(C);
- */
- /* zad 6
- double num = 37.857456;
- int intNum = (int) (num*100);
- System.out.println(intNum % 10);
- */
- /* zad 7
- int year = 2001;
- year = (year%400==0 || year%100!=0) &&(year%4==0) ? year + year: -1;
- System.out.println(year);
- */
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement