Computer Science, asked by hrusikeshchoudary, 1 month ago

Write a program in Java to store 10 numbers (including positive and negative number
in a Single Dimensional Array (SDA). Display all the negative numbers followed
the positive numbers without changing the order of the numbers
Sample Input:
n[0] n[1]
n[3]
n[6] n[7]
n[4]
n[2]
n[5]
71
15
-19
21
54
-32
61
-41
n[8]
10.
n19
-44
52
Sample Output: -32, 41, -19, 44, 15, 21, 54, 61, 71, 52 50 marks ​

Answers

Answered by bkbebybahen
6

Answer:

import java.util.Scanner;

public class KboatSDANumbers

{

public static void main(String args[]) {

Scanner in = new Scanner(System.in);

int arr[] = new int[10];

System.out.println("Enter 10 numbers");

for (int i = 0; i < arr.length; i++) {

arr[i] = in.nextInt();

}

for (int i = 0; i < arr.length; i++) {

if (arr[i] < 0)

System.out.print(arr[i] + ", ");

}

for (int i = 0; i < arr.length; i++) {

if (arr[i] >= 0)

System.out.print(arr[i] + ", ");

}

}

Explanation:

please mark the brainliest and thanks

Answered by TwilightPrincessBee
68

Answer:

cell address is a combination of a column letter and a row number that identifies a cell on a worksheet. For example, A1 refers to the cell at the intersection of column A and row 1; B2 refers to the second cell in column B, and so on.

Similar questions