From 2790d45aba3aeeeb3b40ca14d153046f19de93b8 Mon Sep 17 00:00:00 2001 From: Divyanshu Shukla <100156820+Divyanshu6566@users.noreply.github.com> Date: Sun, 23 Oct 2022 20:23:38 +0530 Subject: [PATCH] Example code for if, elseif and else in java --- If_else_example.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 If_else_example.java diff --git a/If_else_example.java b/If_else_example.java new file mode 100644 index 0000000..340afb2 --- /dev/null +++ b/If_else_example.java @@ -0,0 +1,12 @@ +public class If_elseif_else { + public static void main(String[] args) { + int n =40000; + if (n>15555){ + System.out.println(n+2000); + }else if (n>21000){ + System.out.println(n+3000); + }else + System.out.println(n+5000); + } + + }