Pratian technologies Company Programming Program

state the output of the following code:

intnum=8;
inti=1;
int s=-1;
while(i<=num)
System.out.println((i++*s=-s)) +" ");

Read Solution (Total 20)

Pratian technologies Other Question

The difference between a two digit number and the number obtained by interchanging the positions of its digits are 36.what is the difference between largest and smallest of these two digits? 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);