This is a Basic Java Calculator using If..ElseIf..Else Statement.
Popular Posts
-
This is a Basic Java Calculator using If..ElseIf..Else Statement.
-
import java.util.Scanner; class completename{ public static void main(String args[]){ Scanner user_input = new Scanner(System.in); ...
i m finding a little bit problem in the last codding .
ReplyDelete@@@@@
import java.util.scanner;
class calculator
{
public static void main(Strng args[])
{
Scanner user_input = new Scanner(System.in);
double ch;
int ch;
System.out.println("1. addition");
System.out.println("2. subtratcion");
System.out.println("3. multiplication");
System.out.println("4. division");
System.out.println("choose your operator:");
ch = user_input.nextInt(" ");
if (ch ==1)
{
System.out.println("you chose addition ");
System.out.println("entre the first no;");
x = user_input.nextDouble();
System.out.println("entre the second no");
y = user_input.nextDouble();
z = x+y;
System.out.println(z);
}
else if (ch==2)
{
System.out.println("you chose subtraction");
System.out.println("entre first no");
x = user_input.nextdouble();
System.out.println("entre the second no");
y = user_input.nextDouble();
z = x-y;
System.out.println(z);
}
else if(ch==3);
{
System.out.println("your operation is multiplication");
System.out.println("entre the first no");
x = user_input.nextDouble();
System.out.println("entre the second no");
y = user_input.nextDouble();
z = x*y;
System.out.println(z);
}
else if(ch==4);
{
System.out.println("your operation is division");
System.out.println("entre the first no");
x = user_input.nextDouble();
System.out.println("entre the second no");
y = user_input.nextDouble();
z = x/y;
System.out.println(z);
}
else
{
System.out.println("you can choose only 1--4 ");
}
}
}
The site was so nice, I found out about a lot of great things. I like the way you make your blog posts. Keep up the good work and may you gain success in the long run.
ReplyDeletepython training in OMR
python training in Bangalore
python training in rajajinagar
Python training in btm
Python training in usa
It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful to me...
ReplyDeleteData Science training in kalyan nagar
Data Science training in OMR
selenium training in chennai
Data Science training in chennai
Data science training in velachery
Awesome..You have clearly explained …Its very useful for me to know about new things..Keep on blogging..
ReplyDeleteangularjs Training in chennai
angularjs Training in chennai
angularjs-Training in tambaram
angularjs-Training in sholinganallur
angularjs-Training in velachery
I read this post two times, I like it so much, please try to keep posting & Let me introduce other material that may be good for our community.
ReplyDeletepython training in tambaram | python training in annanagar | python training in jayanagar
All are saying the same thing repeatedly, but in your blog I had a chance to get some useful and unique information, I love your writing style very much, I would like to suggest your blog in my dude circle, so keep on updates.
ReplyDeleteJava training in Tambaram | Java training in Velachery
Java training in Omr | Oracle training in Chennai
Wonderful bloggers like yourself who would positively reply encouraged me to be more open and engaging in commenting.So know it's helpful.
ReplyDeleteData Science Training in Indira nagar | Data Science Training in btmlayout
Python Training in Kalyan nagar | Data Science training in Indira nagar
Data Science Training in Marathahalli | Data Science Training in BTM Layout
ReplyDeleteHello! This is my first visit to your blog! We are a team of volunteers and starting a new initiative in a community in the same niche. Your blog provided us useful information to work on. You have done an outstanding job.
AWS Training in Bangalore | Amazon Web Services Training in Bangalore
AWS Training in Bangalore |Best AWS Training Institute in BTM ,Marathahalli
AWS Training in Rajaji Nagar | Amazon Web Services Training in Rajaji Nagar
AWS Training in Chennai |Best Amazon Web Services Training in Chennai
Appreciating the persistence you put into your blog and detailed information you provide
ReplyDeletedevops online training
aws online training
data science with python online training
data science online training
rpa online training
Your very own commitment to getting the message throughout came to be rather powerful and have consistently enabled employees just like me to arrive at their desired goals.
ReplyDeleteJava Training in Chennai | Best Java Training in Chennai
C C++ Training in Chennai | Best C C++ Training in Chennai
Data science Course Training in Chennai | No.1 Data Science Training in Chennai
RPA Course Training in Chennai | No.1 RPA Training in Chennai
AWS Course Training in Chennai | No.1 AWS Training in Chennai
Devops Course Training in Chennai | Best Devops Training in Chennai
Selenium Course Training in Chennai | Best Selenium Training in Chennai
Java Course Training in Chennai | Best Java Training in Chennai
Web Designing Training in Chennai | Best Web Designing Training in Chennai
MATLAB TRAINING IN CHENNAI | BEST MATLAB TRAINING IN CHENNAI
EMBEDDED SYSTEMS TRAINING IN CHENNAI | BEST EMBEDDED TRAINING IN CHENNAI | EMBEDDED SYSTEMS COURSE IN CHENNAI
MCSA / MCSE TRAINING IN CHENNAI | BEST MCSE TRAINING IN CHENNAI | MCSE COURSE IN CHENNAI
CCNA TRAINING IN CHENNAI | BEST CCNA TRAINING IN CHENNAI | CCNA COURSE IN CHENNAI
It’s great to come across a blog every once in a while that isn’t the same out of date rehashed material. Fantastic read.
ReplyDeleteRPA Course Training in Chennai |Best RPA Training Institute in Chennai
AWS Course Training in Chennai |Best AWS Training Institute in Chennai
Devops Course Training in Chennai |Best Devops Training Institute in Chennai
Selenium Course Training in Chennai |Best Selenium Training Institute in Chennai
Java Course Training in Chennai | Best Java Training Institute in Chennai
Appreciating the persistence you put into your blog and detailed information you provide.
ReplyDeleteDevops Course Training in Chennai |Best Devops Training Institute in Chennai
Selenium Course Training in Chennai |Best Selenium Training Institute in Chennai
Java Course Training in Chennai | Best Java Training Institute in Chennai
I wish to show thanks to you just for bailing me out of this particular trouble.As a result of checking through the net and meeting techniques that were not productive, I thought my life was done.
ReplyDeleteBest PHP Training Institute in Chennai|PHP Course in chennai
Best .Net Training Institute in Chennai
Dotnet Training in Chennai
Dotnet Training in Chennai
Dotnet Training in Chennai
The blog is really very informative. thanks for sharing this blog. easily able to understand the concepts of this blog is easy.
ReplyDeleteData Science Training Course In Chennai | Data Science Training Course In Anna Nagar | Data Science Training Course In OMR | Data Science Training Course In Porur | Data Science Training Course In Tambaram | Data Science Training Course In Velachery
I must appreciate you for providing such a valuable content for us.
ReplyDeleteDigital Marketing Training in Chennai | Certification | SEO Training Course | Digital Marketing Training in Bangalore | Certification | SEO Training Course | Digital Marketing Training in Hyderabad | Certification | SEO Training Course | Digital Marketing Training in Coimbatore | Certification | SEO Training Course | Digital Marketing Online Training | Certification | SEO Online Training Course
Amazing code... I really need it 🤗
ReplyDeletePython Training in Chennai | Infycle Technologies
ReplyDeleteLike this or that software is best nowadays, Hence python training institutes in Chennai are grooming big. Here, Infycle leading in the top position. Because of good & Friendly trainers, Hi-Fi environment, 200% practical classes, pre-interview session. Along with coaching, they give new confidence to students. Via Infycle, you can able to mold your career in a good way. For more details contact Infycle at 7502633633.
Best python trainig in Chennai