P19 - Decision making statements (if & if else) in java | Core Java | Java Programming |

P19 - Decision making statements (if & if else) in java | Core Java | Java Programming |

H Y R Tutorials - Telugu

2 года назад

125,803 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

jai surya
jai surya - 08.11.2023 11:01

Hey buddy!! These are the Assignments answers, Tell me in case of wrong.

1) Verify any given number is Even or Odd.

public Static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Enter n value");
int n = sc.nextInt();
if(n%3==0)
System.out.println("Given number is Odd");
else

System.out.println("Given number is Even");
}

2) Print the Student results based on the grading system.

public static void main(String[] args) {
Scanner scanner= new Scanner(System.in);
System.out.println("Enter n value :");
int n = scanner.nextInt();
if (n<35)
System.out.println("Student is Failed");
else if (n==35)
System.out.println("Student is Passed");
else if (n>35 && n<70)
System.out.println("Student secured third class");
else if (n>70 && n<85)
System.out.println("Student secured Second class");
else
System.out.println("Student doesn't scored anything");
}

3) Print the statements based on day name.
public static void main(String[] args) {
Scanner scanner= new Scanner(System.in);
System.out.println("Enter Week_Name :");
String Week_Name = scanner.nextLine();
if(Week_Name.equals(Week_Name))
System.out.println("Uff,it's a weekday");
else
System.out.println("Yayy,it's a weekend");

Ответить
Krishna Reddy Marthala
Krishna Reddy Marthala - 06.11.2023 20:27

Bro. Tq tq so much 10 videos chusa 15 years exp valu chepina naku adremkaledu mi video tho 10 mins lo adremindi super super

Ответить
14-DS-Nagamani Cholleti
14-DS-Nagamani Cholleti - 06.11.2023 15:10

Hi sir, Superb explanation👏. I have one query in my Code and want to reach out to you through mail. Can you please share your mail id sir. Please.

Ответить
Krishna Krish🥰
Krishna Krish🥰 - 05.11.2023 06:58

Thank you so much sir ❤

Ответить
Krishna Krish🥰
Krishna Krish🥰 - 05.11.2023 06:57

👍♥️

Ответить
ROHITH KALYAN KUMAR REDDY CHAMALA
ROHITH KALYAN KUMAR REDDY CHAMALA - 03.11.2023 13:32

Hi Bro ,Braces lekunda kooda IF STATEMENT execute avthundhi ,what do you say about this :

int i = 20 ;
if(i<22)
sysout(i);

RESULT : 20
any explaination about this !!????

Ответить
Raj mudunuri
Raj mudunuri - 26.10.2023 12:30

Ekkada rendu else statements mandatory haa

Ответить
Yashwanth Aarem
Yashwanth Aarem - 23.10.2023 14:39

every class is a masterpiece

Ответить
Bachelor Kastalu@rajarockyking
Bachelor Kastalu@rajarockyking - 22.10.2023 14:51

so very great content and it is very clear .....................................................😍😍😍

Ответить
RRN
RRN - 19.10.2023 04:37

Hello HYR , Your teaching skills are exceptional, and attention to detail. Really appreciate all your efforts and support. Thank you and Remain Blessed.

Ответить
Ravi Kumar
Ravi Kumar - 17.10.2023 15:59

thank you sir

Ответить
Dolby Beats
Dolby Beats - 16.10.2023 10:51

Excellent teaching 👌👌👌👌👌👌👌👌👌👌👌👌

Ответить
Gayathri Mallesh
Gayathri Mallesh - 16.10.2023 02:33

Bro meeru mail id send chaishara plz

Ответить
Repalle Bhanuprakash
Repalle Bhanuprakash - 14.10.2023 17:14

Excellent sir....

Ответить
Neeraja Simmalapudi
Neeraja Simmalapudi - 13.10.2023 11:06

I have done my assignment and I got the results perfectly Good Explanation Sir👏👏

Ответить
A.Lakshmi Bhavani
A.Lakshmi Bhavani - 11.10.2023 14:28

😇😇😇😇 pls continue bro....

Ответить
venkata durga benarje sepena
venkata durga benarje sepena - 10.10.2023 21:23

hi bro
thankyou so much for giving your time
and could you please explain or write a program asmt-3
asmt-1

import java.util.Scanner;
public class evenOdd {

public static void main(String[] args) {
Scanner key = new Scanner(System.in);
System.out.println("given number bellow");
int num = key.nextInt();

if ( num%2 == 0 ) {
System.out.println("this is the even Number");
}
else {
System.out.println("this is odd Number");
}

}

}


asmt-2


import java.util.Scanner;
public class StudentResult {

public static void main(String[] args) {
Scanner key = new Scanner(System.in);
System.out.println("enter your Percentage");
int marks = key.nextInt();
System.out.print("Result : ");
if (marks >= 80 && marks <=100) {
System.out.println("First class");
}
else if (marks < 80 && marks >=60) {
System.out.println("Second class");
}
else if (marks < 60 && marks >35) {
System.out.println("Thired class");
}
else if (marks == 35) {
System.out.println("Pass");
}
else if (marks < 35 && marks >= 0) {
System.out.println("Fail");
}
else {
System.out.println("Enter currect Percentage ");
}

}
}

Ответить
Manoj Royal
Manoj Royal - 09.10.2023 18:25

import java.util.Scanner;

public class rmsiQualification {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.println("Hello Welcom, whats your name");
String name=scanner.nextLine();
System.out.printf("hey %s did you attend the exam?\n",name);
String examAttend=scanner.nextLine();
if(examAttend == "yes") {
System.out.println("wait for next process");
}
else {
System.out.println("you go to home");
}

}

}


e code run chesthunte if condition run avvakunda direct else condition print avthundho bro yes ani esthe if condition run avvadam ledhu

Ответить
Factoons
Factoons - 09.10.2023 17:46

Excellent teaching sir,iam big fan of the way you teach sir,Thankyou very much for your java course vedios sir, it is very useful to us sir

Ответить
Gunji Durga Gopala krishna
Gunji Durga Gopala krishna - 06.10.2023 07:35

Nice

Ответить