Pratian technologies Company Programming Definition

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.

Read Solution (Total 1)

Pratian technologies Other Question

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;
}
write a program to generate the following series.Accept the limit upto which the series needs to be generated.
1, -2, 6, -15, 31, -56,....N