If else using
public class Main {
public static void main(String[]arg)
{
//student k marks
// data type int variabel name studentMarks = value 49
int studentMarks = 49;
// (>= gratorThan equle to) oprator malom kary ga k studentMarks ziada hy 50 sy. ya equle hy 50 k.
// ya 50 jo pass hony k liy shart hy Ya kam hy 50 sy.
if (studentMarks>=50)
{
// agar student k marks 50 ho ya 50 sy ziada ho to passed print hojay ga
System.out.println("passed");
}
else
{
// agar studnet k marks 50 sy kam ho to "Failed" print hojay ga.
System.out.println("Failed");
}
}
}
Comments
Post a Comment