Posts
Showing posts from September, 2025
level-1
- Get link
- X
- Other Apps

Easy Basics: Conditions & Loops in Java – Animation & Gaming Easy (Basics: Conditions & L ) 1. Bus Ticket Counter Story: A conductor issues tokens to passengers. Each passenger must get a number in sequence. Why: Helps students learn loops. Logic: Input: number of passengers. Use for loop to print numbers 1 to n . Extension: use if inside loop to print only even tokens....
if-else statement.....
- Get link
- X
- Other Apps

CORE JAVA 1. Write a program to check if a number is positive or negative. Program: import java.util.Scanner; public class q1 { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.print("Enter a number: "); double g= scanner.nextDouble(); if (g> 0) { System.out.println("The g is positive."); } else if (g < 0) { System.out.println("The g is negative."); ...