Java Tutorial: Practice Questions On Conditionals & Switch Case

preview_player
Показать описание
Java Practice on Conditionals and Switch Case: These questions on conditionals and switch case will give you a nice grip on java concepts.
In this video we will see few most commonly asked programming questions asked in the interviews!

Best Hindi Videos For Learning Programming:

►C Language Complete Course In Hindi -

►JavaScript Complete Course In Hindi -

►Django Complete Course In Hindi -

Follow Me On Social Media
Рекомендации по теме
Комментарии
Автор

I will be dropping the Python tutorial tomorrow.
Make sure to subscribe to the channel :)
Instagram: Instagram.com/CodeWithHarry

CodeWithHarry
Автор

I am honestly saying from depth of my heart that I started feeling confident about my programming skills after following your DSA, C/C++ and java programming playlist. Consider my comment as big complement Harry sir because I am an non IT/CS guy and still I am able to understand really well that's all because of your teaching skills. You might not know what kind of great thing you are doing sir. Respect man🙌🙌🙌 You deserve more appreciation. I am personally refering your channel to those who are searching for great learning experience. Lots of love bhai♥️

prasannaudata
Автор

all those mistakes you made in question 3 gave me so much knowledge. thx

SahilKumar-lmfy
Автор

I am so proud of myself !
Maine Question 3 me Error hone se pahle hi error detect liya tha,
comparing Tax instead of income ..
Thanks for this unintentional mistake to help us learn from that

its_a_joke_Aamir
Автор

0:55
Problem 1 : It will give error because a=11 here = is used to assign values so here we are checking condition so we have to use == for equality check

parishjain
Автор

I am honestly saying that i started confident in java after following your java are amazing bro.

kushalsoni
Автор

Hi bro, I have started watching your videos since I joined college. It's my second semester going on and I have been instructed to learn java from scratch. Thanks for making such amazing videos. The answer to question 5 is :
import java.util.Scanner;
public class leap
{
public static void main(String[] args)
{
int y;
Scanner sc = new Scanner(System.in);
System.out.print("Enter the year 'y' to be checked:");
y = sc.nextInt();
int year =
if(year==1)
{
System.out.print("y is a leap year");
}
else
{
System.out.print("y is not a leap year");
}
}
}

virajsurana
Автор

I Just don't have any words to express my feeling for you, Sir. You are such a good person, who seems to be only in the whole world. You are really working hard for us with no cost, I think you are now a legend of coding learners. Thanks a lot by heart.

lokeshlanjewar
Автор

24:24 --> Question 5.
System.out.println("Enter Year");
Scanner sc = new Scanner(System.in);
int year = sc.nextInt();
if (year%4==0){
System.out.println("leap year");
}
else {
System.out.println("ordinary year");
}
love you sir you have creating me a logic building programmer because i was a dumb guy when i started but day by day i'm thinking a good logics in coding by you. So, Thanks a lot God bless

dev
Автор

Huge respect from PAKISTAN .... I have done my BSCS 5 years back and always i was thinking that coding is impossible for me
but after starting your video course seriously i am getting confidence that coding is not that hard . your are doing Great

ayubawan
Автор

I used to hate coding...but now after seeing your lectures, it seems that coding is super fun and easy...Amazing lectures ❤
Thank you so much for your efforts😁❤
Best youtube channel indeed!!!

nityagupta
Автор

#Question 4
sir you can add default in switch for invalid choosen
Scanner sc=new Scanner(System.in);
System.out.println("Enter your day number");
int day=sc.nextInt();
switch (day)
{
case 1->
case 2->
case 3->
case 4->
case 5->
case 6->
case 7->
default -> System.out.println("Invalid choose");
}

KetroxTrader
Автор

Sir I am 18 years old. And i swear after 6 year I will meet you as a best programmer.

strikermanish
Автор

A full heart of respect to Harry sir ....thanks a lot sir for your wonderful videos...

prabhaharapale
Автор

Harry sir you are doing extremely well for this course I have hit liked for every video of this course, python course and C course please make up to 100 of video for this tutorial we are with you

shahidakhter
Автор

//Q3 (for question 3 try these)

System.out.print("enter your income amount = ");
Scanner sc = new Scanner(System.in);
float inc = sc.nextFloat();
if (inc>=2.5f && inc<5.0f)
{
System.out.println("your tax is = 5%" );
inc = inc * 0.050f ;
System.out.println("total tax is (lack) = " + inc);
}
else if (inc>=5.0f && inc<10.0f)
{
System.out.println("your tax is = 20%");
inc = inc * 0.20f ;
System.out.println("total tax is (lack) = " + inc);
}
else if (inc>=10.0f)
{
System.out.println("your tax is 30%");
inc = inc * 0.30f ;
System.out.println("total tax is (lack) = " + inc);
}
else
{
System.out.println("no tax");
}

ashutoshlahase
Автор

24:05 Leap Year
import java.util.Scanner;

public class Leapyear {
public static void main(String[] args) {

System.out.println("Enter the year to be checked");
Scanner s=new Scanner(System.in);
int yr= s.nextInt();

if((yr%4==0 && yr%100!=0)|| yr%400==0)
System.out.println("Leap year");
else
System.out.println("Not a leap year");
}

}

sumanthachark
Автор

24:26
condition for leap year.
Leap year is divisible by 4 with remainder 0.

lyricspectrum
Автор

System. out. print ("Thanks sir for your java playlist you are awesome");
respect++;

TheTop-txjs
Автор

Man the cwh part was awesome, the way said "sharam karo", 🤣🤣🤣. After all I have been doing great with your videos, did my UG already but did not learn anything, now hopefully will bring something out. Just want to say thank you Harry Bhai.❣

IbnAmin