Watch more such videos in below playlist: Java Tutorial: kzbin.info/aero/PLhyraTKIsw5_WemVMvshNm-0aC7zfISCO Java Programs: kzbin.info/aero/PLhyraTKIsw59nQJKvZTKmNK2aMxHwvLOa
@Hinoligy Жыл бұрын
This helped me understand switches more thx bro
@programmingforbeginners7392 Жыл бұрын
welcome. share with your friends!
@SHIVAMKUMARSHARMA-ps3gl Жыл бұрын
Write a program for calculators in java which performs addition, subtraction, multiplication and division of any two numbers. Take user input using Scanner class and print the results of every calculation. do it
@NikhilVamsi810 ай бұрын
Wahh.... Brilliant job... Nice explanation.. Keep it up 💯👏
@programmingforbeginners739210 ай бұрын
Thanks a lot 😊
@me_master_meme Жыл бұрын
Your explanation is very good keep going : )
@programmingforbeginners7392 Жыл бұрын
Thank you, I will
@khushisingh4584 Жыл бұрын
Thanks for the video it helped me a lot ❤️
@programmingforbeginners7392 Жыл бұрын
Glad it helped!
@roll20nilaydasgupta412 ай бұрын
How we can do the arithmetic operation??? Eg - 1+2-5(3*4)
@SuperWaqas0073 ай бұрын
so much thank full to you sir...
@programmingforbeginners73923 ай бұрын
Most welcome
@Simranrajpoot_ಠ_ಠ24 күн бұрын
Is this the only method using switch case I mean what if we just don't want the user to give the operator or value and declare it by ourselves?????
@programmingforbeginners739223 күн бұрын
You can make the calculator using other algorithms as well.. there are multiple ways
@ilyosshoniyozov6012 Жыл бұрын
Bro you made a mistake which was in 4th operator. You have to put n2=0 System.out.println ("invalid"); Or other things words like that
@Got_viral Жыл бұрын
Thanks bro
@programmingforbeginners7392 Жыл бұрын
Welcome
@meriemmansouri3441 Жыл бұрын
Thank you so much 🙏
@programmingforbeginners7392 Жыл бұрын
You're welcome 😊
@showme13100 Жыл бұрын
Dont we need to return the value of result or is it restricted in switch statement?
@programmingforbeginners7392 Жыл бұрын
We can return the value of result since it is declared under main function.. we just needed to print result so it was printed within main, but you can return it as well if using another function for switch case
@showme13100 Жыл бұрын
@@programmingforbeginners7392 thank you
@furkan809 Жыл бұрын
thank you
@programmingforbeginners7392 Жыл бұрын
You're welcome
@RashmiRashmi-rw4ek3 ай бұрын
the code is showing that the operator is defined first and then again why the declaration is again required
@RashmiRashmi-rw4ek3 ай бұрын
where is the modulus operator??
@Jeremy-m8r11 ай бұрын
Can you tell me how to use multiple operators
@prachitawde69485 ай бұрын
😅
@azharalibalouch3766 Жыл бұрын
wow
@programmingforbeginners7392 Жыл бұрын
Thanks 👍
@Idealbruda4 ай бұрын
Is it necessary to write result =0 , can't we just start from switch
@RashmiRashmi-rw4ek3 ай бұрын
no
@SladeBuffet Жыл бұрын
you should consider that you cannot divide by 0
@weewee3138 Жыл бұрын
It’ll give a logical error
@huyle5011 Жыл бұрын
How to make operator as + - × /
@programmingforbeginners7392 Жыл бұрын
you can ask the user to provide input as one of these 4 operators as a string, and based on the operator and other 2 numbers, the calculations can be done
@hasthapurammonuninni9591 Жыл бұрын
bro how to give continuous input without running programe again and again
@programmingforbeginners7392 Жыл бұрын
Put the code inside loop to continuously use the calculator
@tamilathalainimirtamila912010 ай бұрын
@@programmingforbeginners7392 Bro when I given exit option on the time wise program was get exit other wise prog still running wht a loop i use
@hrushikeswarareddy25111 ай бұрын
how can the program should keep on executing automatically after onetime completion plz let me know
@programmingforbeginners739211 ай бұрын
Put it in while(true) loop to run continuously
@selfsufficient1987 Жыл бұрын
If I choose division and entered two nos as 35 and 45 then it gives me result as 0 Please explain
@programmingforbeginners7392 Жыл бұрын
35/45 gives us result as 0.77 usually but in the Java code we are taking both these numbers as integers and that's why the result of division operation is also integer in this case - 0.77 is taken as 0 in the result.. Change the data type to double for both the inputs taken and you'll get the result as 0.77 Hope this helps 👍
@mann_mann Жыл бұрын
@@programmingforbeginners7392 i have tried but still it is not working properly and it did not print the correct value.
@programmingforbeginners7392 Жыл бұрын
can you please provide your code?
@shuraimzaid6726 Жыл бұрын
Double and float data types can be used in switch statements