JYOTI Prog
JYOTI Prog
JYOTI Prog
import java.io.*;
class EvenOddSum {
int arr[] = { 1, 2, 3, 4, 5, 6 };
if (i % 2 == 0)
even += arr[i];
else
odd += arr[i];
}
4
// Java program to convert a decimal
import java.io.*;
class GFG {
int i = 0;
while (n > 0) {
binaryNum[i] = n % 2;
n = n / 2;
i++;
System.out.print(binaryNum[j]);
}
// driver program
int n = 17;
decToBinary(n);
}
6
import java.util.*;
import java.lang.*;
class GFG{
double allowance;
da = 0.5 * basic;
pf = 0.11 * basic;
if (grade == 'A')
allowance = 1700.0;
allowance = 1500.0;
else
allowance = 1300.0;
}
double gross;
allowance - pf);
return (int)gross;
// Function call
System.out.println(computeSalary(basic, grade));
}
8
if (n == 0 || n == 1) {
return n;
int j = 0;
temp[j++] = a[i];
a[i] = temp[i];
return j;
{
int a[] = { 1, 1, 2, 2, 2 };
int n = a.length;
n = removeduplicates(a, n);
}
9
import java.util.*;
size = sc.nextInt();
arr[i] = sc.nextInt();
freq[i] = -1;
count = 1;
if(arr[i]==arr[j])
count++;
freq[j] = 0;
}
if(freq[i] != 0)
freq[i] = count;
if(freq[i] != 0)
}
13
import java.util.Scanner;
i = 0;
while(i < P.length) {
R[i] = P[i];
i++;
}
int j = 0;
while(j < Q.length) {
R[i++] = Q[j++];
}
int idx;
for (idx = 0; idx < SIZE; idx++) {
if (city.compareToIgnoreCase(cities[idx]) == 0) {
break;
}
}
double t = weightArr[i];
weightArr[i] = weightArr[idx];
weightArr[idx] = t;
}
if (r >= l) {
int mid = l + (r - l) / 2
if (arr[mid] == x)
return mid;
if (arr[mid] > x)
// in array
return -1;
int n = arr.length;
int x = 10;
if (result == -1)
else