script7vineel
BAN USER
Comments (4)
Reputation 0
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
0
of 0 vote
i support mr.deepak since precedence of unary operator is greater than of logical && and logical || operator at first x,y,z values are incremented then or opertion sholud be performed in that way answer should be performed o/p:2,2,1
but why o/p is 2,1,1 when i executed
Comment hidden because of low score. Click to expand.
0
of 0 vote
dynamic array is the solution ...
it allocates all memory contigously in memory keeps count of the current number of elements,if thee space reserved for the dynamic array is exceeded ,it is reallocted and possibly all the before values are copied..but it is an expensive thing
Comment hidden because of low score. Click to expand.
0
of 0 vote
THAT WAS ABSOLUTELY 20,20
ONCE EXECUTE THE CODE BY WRITING IN THE C COMPILER
Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
Scanner userInput=new Scanner(System.in);
- script7vineel November 27, 2015System.out.println("Enter the input number");
int value=userInput.nextInt();
int input2=value;
int repeat=0,k;
for(int i=2;i<=value;i++){
input2=i;
while(input2>0){
k=input2%10;
if(k==2){
repeat++;
}
input2=input2/10;
}
System.out.println(repeat);