diff --git a/FLow_Q2_Krish.java b/FLow_Q2_Krish.java new file mode 100644 index 000000000..6997e7fae --- /dev/null +++ b/FLow_Q2_Krish.java @@ -0,0 +1,18 @@ +// Take two numbers and print the sum of both. +import java.util.Scanner; +class FLow_Q2_Krish +{ + public static void main(String[] args) + { + Scanner sc = new Scanner(System.in); + System.out.print("Enter first number: "); + int num1 = sc.nextInt(); + System.out.print("Enter second number: "); + int num2 = sc.nextInt(); + + int sum = num1 + num2; + System.out.println("The sum of " + num1 + " and " + num2 + " is: " + sum); + + sc.close(); + } +} diff --git a/Flow_Q1_Krishi.java b/Flow_Q1_Krishi.java new file mode 100644 index 000000000..3a07cfb17 --- /dev/null +++ b/Flow_Q1_Krishi.java @@ -0,0 +1,26 @@ +class Year +{ + public static void main(String[] args) { + int year = 2024; // Example year + boolean isLeapYear = false; + + // Check if the year is divisible by 4 + if (year % 4 == 0) { + // If it is divisible by 100, check if it is also divisible by 400 + if (year % 100 == 0) { + if (year % 400 == 0) { + isLeapYear = true; // Divisible by 400, so it's a leap year + } + } else { + isLeapYear = true; // Divisible by 4 but not by 100, so it's a leap year + } + } + + // Output the result + if (isLeapYear) { + System.out.println(year + " is a leap year."); + } else { + System.out.println(year + " is not a leap year."); + } + } +} \ No newline at end of file diff --git a/lectures/20-trees/code/AVL/.project b/lectures/20-trees/code/AVL/.project index a2380fe36..64a5a8be7 100644 --- a/lectures/20-trees/code/AVL/.project +++ b/lectures/20-trees/code/AVL/.project @@ -22,12 +22,12 @@ - 1679078569810 + 1752585926556 30 org.eclipse.core.resources.regexFilterMatcher - node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ diff --git a/lectures/20-trees/code/Questions/.project b/lectures/20-trees/code/Questions/.project index a2380fe36..02f141e09 100644 --- a/lectures/20-trees/code/Questions/.project +++ b/lectures/20-trees/code/Questions/.project @@ -22,12 +22,12 @@ - 1679078569810 + 1752585926573 30 org.eclipse.core.resources.regexFilterMatcher - node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__