Computer Science, asked by pintumondol711, 5 months ago

write a program to pass an integer as argument and find the sum of of odd digits and even digits separately​

Answers

Answered by parthibanbabu856
2

Answer:

public class Sum_Odd_Even.

int n, sumE = 0, sumO = 0;

Scanner s = new Scanner(System.

System. out. print("Enter the number of elements in array:");

n = s. nextInt();

int[] a = new int[n];

System. out. println("Enter the elements of the array:");

for(int i = 0; i < n; i++)

Answered by craftwithvara
2

Answer:

Java Program to Calculate the Sum of Odd & Even Numbers

public class Sum_Odd_Even.

int n, sumE = 0, sumO = 0;

Scanner s = new Scanner(System.

System. out. print("Enter the number of elements in array:");

n = s. nextInt();

int[] a = new int[n];

System. out. println("Enter the elements of the array:");

for(int i = 0; i < n; i++)

Similar questions