การใช้else
else เป็นการนำคำสั้งของเงื่อนไข เมื่อสิ่งที่มาจาก if=>F
import java.util.*;
public class numberif{
public static void main(String[] args) {
int num1 = new Scanner(System.in).nextInt();
if(num1 == 50) System.out.println(" the number = " + 50);
else if(num1 > 50 ) System.out.println(" the number > 50 ");
else System.out.println(" the number < 50 "); } }
down load
http://www.uploadtoday.com/download/?35a650703f1dbf43ad0eb1b27c32e8be
วันพฤหัสบดีที่ 30 สิงหาคม พ.ศ. 2550
สมัครสมาชิก:
ส่งความคิดเห็น (Atom)
ไม่มีความคิดเห็น:
แสดงความคิดเห็น