Solved 2024 ICSE Computer Applications Class X Boards Paper - "EvenPal"

Ayush VanvaryAyush Vanvary
1 min read

In this article we see the solution of Question 5. of Section B.

The solution would be simple, as per syllabus standard not very much abstracted and verbose but it will pretty straight forward.

You can easily copy the code by clicking on copy button mentioned on top right or simply by ctrl A and ctrl C.


import java.util.Scanner;
public class EvenPal
{
    public static void main(String args[])
    {
        Scanner sc= new Scanner(System.in);
        System.out.println("Enter any No.");
        int n=sc.nextInt();
        int rev,sum,cp;
        cp=n;
        sum=rev=0;
        while(n>0)
        {
            int d=n%10;
            sum+=d;
            rev=rev*10+d;
            n/=10;
        }
        if(rev==cp && (sum%2==0))
            System.out.println("No. is EvenPal");
        else
            System.out.println("No. is not EvelPal");
    }
}

If you have any questions or want to share your answer you wrote during the paper, please do so in the comments.

Follow Ayush Vanvary

Instagram- vanvaryclasses.in

0
Subscribe to my newsletter

Read articles from Ayush Vanvary directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Ayush Vanvary
Ayush Vanvary

Hello, I'm Ayush Vanvary. Skilled in Python Django and MySQL, I'm equally passionate about sharing my expertise as a tech educator. With experience as a Java tutor, I've honed both my coding prowess and teaching abilities. Additionally, I regularly contribute insights through straightforward, informative tech blogs, enriching readers and nurturing a vibrant community