Pratian technologies Company Programming Program

state the output of the following code:
intnum=80;
inti=1;
intmul=1;
while(i<=num){
System.out.println(i+" ");
i+=4*mul++;
if(mul%3==0)
++mul;
}

Read Solution (Total 11)

Pratian technologies Other Question

state the output of the following code:

longnum=11010;
long d=0;
long rem=0;
long p=1;
while(num!=0){
rem=num%10;
d=d+rem*p;
p=p*2;
num/=10;
}
System.out.println(d);


optimize the code by applying the following logic.
The LCM for 2,3,4,5 and 6 is 60.This means that 61,121,181 etc. gives remainder 1, when divided by 2,3,4,5 and 6.You have to check whether 61,121,181 etc are now multipled. Display and mention the number of iterations needed to generate in the first case and last case.