Write a java program that computes the double and
half of a , where a stores 10.92.
Answers
Answered by
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
English,
3 months ago
Science,
3 months ago
English,
3 months ago
Computer Science,
7 months ago
Business Studies,
7 months ago
Accountancy,
11 months ago
English,
11 months ago
Science,
11 months ago