In this video, I explain the Magic String Program in Java for ICSE Class 10 Computer Applications students. A Magic String is a string where two consecutive characters are in alphabetical order (e.g., "PO" or "DE"). This is a very important question for String Handling in the 2026 Boards.
I break down the logic step-by-step, showing you how to compare characters using ASCII values and how to structure your loop correctly in Java.
💻 Logic Used in this Program:
Input a string (e.g., "NO").
Run a loop from 0 to length-1.
Extract the character at i and i+1.
Check if charAt(i) + 1 == charAt(i+1).
If true, it is a Magic String.
📚 More ICSE Computer Applications Videos: https://www.youtube.com/playlist?list=PLlzqIk3sO9oZUGrpdcvXzu1ECE_d__GvT
Connect with me: Insta: @iamanurag121 Subscribe to Learn Easily - By Anurag for more ICSE Java tutorials!
#ICSEClass10 #JavaProgramming #StringHandling #ComputerApplications #ICSE2026 #LearnEasilyByAnurag #BlueJ
Download
0 formats
No download links available.
Magic String Program in Java | ICSE Class 10 Computer Applications | String Handling 2026 Boards | NatokHD