Page 122 - CA_Blue( J )_Class10
P. 122

if(b==0)
                                                                                Start
                      System.out.println(b + " is equal to 0");
                  if(c==0)
                      System.out.println(c + " is equal to 0");             a=4, b=2,c=0


                                                                                             true
                                                                               if(a==0)                  a is equal to 0

                                                                              false

                                                                                             true
                                                                               if(b==0)                  b is equal to 0

                                                                              false

                                                                                             true
                                                                               if(c==0)                  c is equal to 0

                                                                              false


                                                                                 End


                             To input marks of three different subjects of a student and print whether the student has got more
                Program 4
                             than 90% marks in each subject.
                 1  import java.util.*;
                 2  class marks

                 3      {

                 4          public static void main()
                 5          {
                 6              Scanner sc= new Scanner(System.in);

                 7              String name;
                 8              int phy_marks,chem_marks,comp_marks;

                 9              System.out.print("Enter name of the student : ");
                10              name = sc.nextLine();

                11              System.out.print("Enter Physics marks :");

                12             phy_marks=sc.nextInt();
                13             System.out.print("Enter Chemistry marks :");

                14             chem_marks=sc.nextInt();
                15             System.out.print("Enter Computer marks :");

                16             comp_marks=sc.nextInt();
                17             System.out.println("----------------------------");

                18             System.out.println("Name of the Student : "+ name);


                120120  Touchpad Computer Applications-X
   117   118   119   120   121   122   123   124   125   126   127