Bharat
BAN USER- 2of 2 votes
AnswersFind out the no of times the statement will get executed for the below code snippet.
- Bharat in India
int temp = 1;
for(int i =0; i <n; i++) {
for(int j = 0; j<= i; j++) {
for(int k= 0; k <= j; k++) {
temp++;
}
}
}
System.out.prinln(temp); // Or what will be the value of the temp?.| Report Duplicate | Flag | PURGE
GE (General Electric) Senior Software Development Engineer - 0of 0 votes
AnswersFind the no classes, no methods and the no class level variables from a given Java file...
- Bharat in India
Example :
Input: test.java
Output:
Number of class in Java file. : Class names
Number of Methods in Each class : count of methods for each class
Number of Class variables : Count of variables for each class.| Report Duplicate | Flag | PURGE
GE (General Electric) Senior Software Development Engineer Algorithm
public int pair(int arr[]) {
int index = 0;
int current_sum = 0;
int previous_sum = Integer.MAX_VALUE;
for (int i = 0; i < arr.length-1; i++) {
current_sum = arr[i] + arr[i+1];
current_sum = Math.abs(current_sum);
if (current_sum < previous_sum){
index = i;
previous_sum = current_sum;
}
}
return index;
}
Repryandchinkle, Android Engineer at ABC TECH SUPPORT
I was born in Northridge USA, I like photography, I have wide photos collection of wildlife. I have many religious ...
Reppaynealiciam, Apple Phone Number available 24/7 for our Customers at Adap.tv
Hello I am Sarah Cote, and I live in Missouri, USA. Last year, Web trailblazer. Passionate entrepreneur. Subtly charming bacon ...
Its producer-consumer problem where writer should be treated as producer and reader as consumer, use either blocking queue method or wait-notify better to use blocking queue as wait-notify constraint will be taken care by this blocking queue API
- Bharat June 13, 2013