Hi ALL,
Here I wrote a program for Sentinel Value Generation in java Example 1.
/**
*
* @author Balamurgan
M
*/
public class sentinelValue1 {
public static void
main(String arg[]){
System.out.println(" Senthinel value 1");
double x=1;
double sum=0;
while(x!=0){
sum +=x;
x -=0.1;
}
System.out.println(" X value "+ x +" Sum Value
"+sum);
}
}
No comments:
Post a Comment