M Iftikhar

Greenhorn
+ Follow
since Oct 09, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by M Iftikhar

The voice conversation with Impulse has ended.
int i = 1234567899;
float j = i; //float will convert the value 1234567940 0r 1.23456794E9
System.out.println(j);
// (int) j; this will convert the 1234567940 into 1234567930
// finally the result will be 12345678899 - 1234567930 = -31(approximately)
Basically the compiler will not convert the accurate value from float
to int because the this is explicit narrowing conversion evan though the
value is in the range.
that why you will get the unexpected result.


------------------
Iftikhar
There are two methods of sorting .
1 Bubble sorting
2 Internal sorting
Following is the procedure of internal sortting
int i=0,j=0,temp=0;
for(i=0 ; i < aa.length() ; i++){
for(j=i+1; j<=aa.length() ;j++){
if(aa[i] > aa[j]){
temp=aa[i];
aa[i] = aa[j];
aa[j] = temp;
}
}
}
Note :
Not sure aboout the method of aa.length() or aa.length


23 years ago