Computer Science, asked by saedabegum6, 7 months ago

Write a java program that computes the double and

half of a , where a stores 10.92.​

Answers

Answered by Trishitshah16w14
3

Answer:

Hello, I have codded JavaScript see it

Explanation:

// Java program to find value

// if we double the value after

// every successful search

class GFG

{

// Function to Find the value of k

static int findValue(int arr[], int n, int k) {

// Search for k. After every successful

// search, double k.

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

if (arr[i] == k)

k *= 2;

return k;

}

// Driver Code

public static void main(String[] args)

{

int arr[] = {2, 3, 4, 10, 8, 1}, k = 2;

int n = arr.length;

System.out.print(findValue(arr, n, k));

}

}

// This code is contriubted by

// Smitha Dinesh Semwal

mark me brainliest answer and follow me

Similar questions