Computer Science, asked by rathodvarun270, 16 days ago

do this fast
urget plss send fast​

Attachments:

Answers

Answered by suryakantp8a48
0

Answer:

4567 number is odd one so it is odd one

Answered by sahunix
0

import java.util.*;

class MAIN

{

   public static void main(String args[])

   {

       Scanner sc = new Scanner(System.in);

       String n;

       int i,l,sum=0;

       System.out.println("Enter a number:");

       n = sc.nextLine();

       l = n.length();

       if (l >= 3)

       {

           if (l == 3)

               System.out.print(n.charAt(l-2));

           else

               for (i=1;i<l-2;i++)

               {

                   sum = sum + Character.getNumericValue(n.charAt(i));

                   System.out.print(n.charAt(i)+"+");

               }

           sum = sum + Character.getNumericValue(n.charAt(l-2));

           System.out.print(n.charAt(l-2)+"="+sum);

       }

       else

           System.out.println("Wrong number");

   }

}

Similar questions