PFB #25 - Practical Exercise in Java (Conditional Statements)

preview_player
Показать описание
In this video, we will write programs to some questions in Java related to Conditional statements (if-else)

Рекомендации по теме
Комментарии
Автор

Your the best man, I appreciate your clear and precise explanations

Niche_Edits
Автор

bro what if we have to convert the marks to percentage in the first question how to do it?

Jane-pg
Автор

Bro at 21:35 no need to use math.pow
U can also use num**n right?? For this int is enough

pujithagaddale
Автор

can we use this type only using Scanner and if-else
public static void main (String[] args) throws java. lang.Exception
{
Scanner sc =new Scanner(System.in);
System.out.println("age");
byte age = sc.nextByte();
System.out.println("kitte marks laya ");
int marks = sc.nextInt();
if(age >17 || age <21 && marks >80)
System.out.println("paisa hi paisa");
else {
System.out.println("paisa barbad bc ");
}
}

siddharthramteke
Автор

Watch in 1.5x speed . It would be helpful

minimix
Автор

import java.util.Scanner;
public class condition_practice {
public static void main(String[] args) {
//Q.3 Check if a traingle is a a right angle triangle or isoceles traingle.
Scanner sides = new Scanner(System.in);
System.out.println("side 1");
float s1 =sides.nextFloat();
System.out.println("side 2");
float s2 =sides.nextFloat();
System.out.println("side 3");
float s3 =sides.nextFloat();
// check if triangle is right angle or not
if ((s1==Math.sqrt(Math.pow(s2, 2)+Math.pow(s3, 2)))||
(s2==Math.sqrt(Math.pow(s3, 2)+Math.pow(s1, 2)))||
(s3==Math.sqrt(Math.pow(s2, 2)+Math.pow(s1, 2))) ){
System.out.println("This is a right angle triangle");
} else if (s1==s2||s2==s3 ||s3==s1) {
System.out.println("this is an isocelus triangle");
}

}
}

mr.indianvibe
join shbcf.ru