paramjit1992singh
BAN USER
- 0of 0 votes
AnswerA tuple can contain a list as an element.
- paramjit1992singh in India for python basics
True
or
False| Report Duplicate | Flag | PURGE
Amdocs Developer Program Engineer - 0of 0 votes
AnswersAll O(1) functions take exactly the same amount of time to run.
- paramjit1992singh in India for python basics
True
or
False| Report Duplicate | Flag | PURGE
Amdocs Developer Program Engineer - 0of 0 votes
AnswersAfter a mutable object has been created, its identity can change.
- paramjit1992singh in India for python basics
True
or
False| Report Duplicate | Flag | PURGE
Amdocs Developer Program Engineer - 0of 0 votes
AnswerAfter a mutable object has been created, its value can change.
- paramjit1992singh in India for python basics
True
or
False| Report Duplicate | Flag | PURGE
Amdocs Developer Program Engineer
/**
*
*/
package h;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.lang.reflect.Array;
/**
* @author vaio
*
*/
public class birthdaeth {
/**
* @param args
* @throws IOException
* @throws NumberFormatException
*/
public static void main(String[] args) throws NumberFormatException, IOException {
// TODO Auto-generated method stub
BufferedReader br= new BufferedReader(new InputStreamReader(System.in));
int i=0,j,year=0,n,b,d;
int birth[]=new int[1000];
int dead[]=new int[1000];
int startRange=1900,endRange=2000;
for(;startRange<=endRange;startRange++)
{
i++;
System.out.println("How many People are born in the year" + startRange);
b=Integer.parseInt(br.readLine());
birth[i]=b;
System.out.println("How many People died in the year" + startRange);
d=Integer.parseInt(br.readLine());
if(d>b){
System.out.println("How can dead be greater than born!!! Re-enter");
i--;
startRange--;
}else{
dead[i]=d;
}
}
startRange=endRange-i;
i=0;
int alive=0;
for(;startRange<=endRange;startRange++)
{
i++;
j=birth[i]-dead[i];
if(j<0 ||j<alive){
continue;
}
if(j>alive){
alive=j;
year=startRange+1;
}
}
System.out.println("Max people ie "+alive+" where alive in the year"+ year );
}
}
/**
- paramjit1992singh November 30, 2014*
*/
package h;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/**
* @author vaio
*
*/
public class twoNoWhosSumis10 {
/**
* @param args
* @throws IOException
* @throws NumberFormatException
*/
public static void main(String[] args) throws NumberFormatException, IOException {
// TODO Auto-generated method stub
BufferedReader br= new BufferedReader(new InputStreamReader(System.in));
int n,i,j,sum,k,l,r,s;
System.out.println("how large you want to make the array of unsigned int");
n=Integer.parseInt(br.readLine());
int arr[]=new int [n];
int dupli[]=new int [n];
for(i=0;i<n;i++)
{
System.out.println("Enter your value into the postion no "+(i+1)+" in the array");
j=Integer.parseInt(br.readLine());
if(j<0){
System.out.println("Did you forget that we are dealing with array of unsigned int!!! Re-enter ");
j=0;
i--;
}else{
arr[i]=j;
}
}
k=-1;l=-1;
r=0;s=1;
int flag1=0;int flag2=0,q;
dupli[0]=-1;
for(i=0;i<n;i++)
{
for(j=0;j<n;j++){
if(i!=j){
sum=arr[i]+arr[j];
if(sum==10 && k!=arr[i] && l!=arr[j] && k!=arr[j] && l!=arr[i]){
k=arr[i]; l=arr[j];
for(q=0;q<s;q++){
if(dupli[q]==k){
flag1=1;
break;}
else
flag1=0;
}
for(q=0;q<s;q++){
if(dupli[q]==l){
flag2=1;
break;}
else
flag2=0;
}
if(flag1==0 && flag2==0){
dupli[r]=k;
dupli[s]=l;
r+=2; s+=2;
System.out.println("The two number whose sum is 10 are "+k+" and "+l);
}
}
else{
continue;
}
}
}
}
}
}