UrbanPro

Take BTech Tuition from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

write a program to perform addition,subtraction,multiplication,division with switch statement

Asked by Last Modified  

9 Answers

Follow 0
Answer

Please enter your answer

The tutor

U can just Google it. It's very simple one
Comments

MathWorks Certified MATLAB Associate

Switch case Syntax in MATLAB is switch switch_expression case case_expression statements case case_expression statements ... otherwise statements end
Comments

MathWorks Certified MATLAB Associate

switch switch_expression case case_expression statements case case_expression statements ... otherwise statements end
Comments

int main() { char o; float num1,num2; printf("Enter operator either + or - or * or divide : "); scanf("%c",&o); printf("Enter two operands: "); scanf("%f%f",&num1,&num2); switch(o) { case '+': printf("%.1f + %.1f = %.1f",num1, num2, num1+num2); ...
read more
int main() { char o; float num1,num2; printf("Enter operator either + or - or * or divide : "); scanf("%c",&o); printf("Enter two operands: "); scanf("%f%f",&num1,&num2); switch(o) { case '+': printf("%.1f + %.1f = %.1f",num1, num2, num1+num2); break; case '-': printf("%.1f - %.1f = %.1f",num1, num2, num1-num2); break; case '*': printf("%.1f * %.1f = %.1f",num1, num2, num1*num2); break; case '/': printf("%.1f / %.1f = %.1f",num1, num2, num1/num2); break; default: /* If operator is other than +, -, * or /, error message is shown */ printf("Error! operator is not correct"); break; } return 0; } o/p Enter operator either + or - or * or divide : - Enter two operands: 3.4 8.4 3.4 - 8.4 = -5.0 read less
Comments

Tutor

in which language you want to write the program
Comments

Life Scientist

Not related to my expertise
Comments

Trainer

simple u can even get from 1000 program from web
Comments

switch(op) { case '+': c=a+b; break; case '-':c=a-b; break; case '*':c=a*b; break; case '/':c=a/b; break; default: printf("Please check the operator"); } Here op is a character for the operation you r going to perform. Instead you can send a string like add sub etc in double quotes.
Comments

Phd In Electrical Engineering

if you are an hardware engineer and know verilog or vhdl or systemc you can do this by refering to various computer arithmetic books which gives algorithm using logic gates and that can be implement with cas switch statements
Comments

View 7 more Answers

Related Questions

How can a B.tech mechanical student become an IPS officer?
Hi, good to see someone aspiring for IPS . First forms are out in December , available in any head post office all over country. Fill it and sent to dholpur, New delhi . Then you will have to clear first...
Saswat
0 0
8
How can I improve my spoken English?
Try to speak simple sentences.Concentrate in the usage of tenses and preposition. Communicte in english with your friends for atleast 30 minutes a day.
Dharmendra
How to use recursive function in C?
Recursion is the process of repeating items in a self-similar way. In programming languages, if a program allows you to call a function inside the same function, then it is called a recursive call of the...
Pragati
Hi, I want to become a software Engineer , so what steps should I follow. Should I prefer IIT or not? I'm going to take admission in class 11th , so please advice me that if IIT is a good option for my career or not. If yes, than I'll star IIT JEE coaching classes with 11th and 12th. Please reply as fast as possible. Thanks.
Yes, you should start preparing for IIT JEE because for becoming a software engineer u need to get admitted in a good engineering college and as we all know IITs are best, also if u will aim for IIT then you can atleast get NITs very easily.
Mayank
What is the importance of PLC? in electrical field.
PLC has replaced the hard wired logic controls.if you want to change the logic,that can be done in few moments and most important the complicated logic by hard wired are very simple with the help of PLC.
Mahima

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

Learn by Examples
To get any perticular concept of any subject, there are few basic steps. Take the problem based on the concept you are trying to learn. Read the problem and identify the context Check whether you...
P

Do and Dont's
-Learn By Examples, By relating it to real life things. You will retain it for long. -Dont ever wait for your teachers or tutors for starting something new topics. Make your own pace study before enyone...

Answer writing skills for the final examination
Dear Students,Answer writing for the final examination is explained clearly in the videos so please watch the video and also subscribe for the channel for more examination techniques.


SINCERE SYSTEMATIC STUDY SECURE SUPREME SUCCESS- 6 S FOR SUCCESS
SINCERE SYSTEMATIC STUDY SECURE SUPREME SUCCESS - 6 S FOR SUCCESS

Recommended Articles

MBA, Medicine and engineering are the three main professional courses in India. Engineering is still one of the highly sorted after professional courses in the under graduate level, while MBA is favoured as a preferred post graduate course. To shine in these courses, one needs to work and study hard. Engineering as a...

Read full article >

According to a recent survey conducted by the NCAER (National Council of Advanced Economic Research), engineering is the most sought after course in India. Some engineering courses are offered as BE or Bachelor of Engineering while some as Bachelor in Technology or B.Tech. Since engineering is a professional course, the...

Read full article >

Appearing for exams could be stressful for students. Even though they might have prepared well, they could suffer from anxiety, tension etc. These are not good for their health and mind. However, following a few exam preparation tips can save them from all these and help them to score good marks. Let’s find out all...

Read full article >

With the mushrooming of international and private schools, it may seem that the education system of India is healthy. In reality, only 29% of children are sent to the private schools, while the remaining head for government or state funded education. So, to check the reality of Indian education system it is better to look...

Read full article >

Looking for BTech Tuition ?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
X

Looking for BTech Tuition Classes?

The best tutors for BTech Tuition Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Take BTech Tuition with the Best Tutors

The best Tutors for BTech Tuition Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more