Hi ALL,
Here I wrote a program for Sentinel Value using Break point in java Example 2.
/**
*
* @author Balamurgan
M
*/
import java.util.Scanner;
public class SentinelValue {
public static void
main(String arg[]){
System.out.println("Sentinel Value");
Scanner in=new
Scanner(System.in);
System.out.println(" enter the break point number ");
int
breakPoint=in.nextInt();
for (int
i=0;i<5000;i++){
System.out.println(i);
if(i==breakPoint)
break;
}
System.out.println("break point is worked");
}
}
No comments:
Post a Comment