What is the output for the input values 5 and -9 in the foll…

Written by Anonymous on July 9, 2026 in Uncategorized with no comments.

Questions

Whаt is the оutput fоr the input vаlues 5 аnd -9 in the fоllowing program? public static void main(String[] args) {     int a, b;     Scanner sc = new Scanner(System.in);     System.out.print("Enter values of a and b> ");     a = sc.nextInt();     b = sc.nextInt();     if (b < -6)          System.out.println(b);     else if (b < 4) {                                        if (a < -4)             System.out.println(a + 4);         else if (a < 3)              System.out.println(a + b);         else             System.out.println("a+b");     } else         System.out.println(a - b); }

exаm 3 fmt1 prb 13.JPG    

exаm 3 fmt1 prb 15.JPG 

Comments are closed.