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  

Follow 0
Answer

Please enter your answer

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

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

The tutor

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

Tutor

in which language you want to write the program
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

Life Scientist

Not related to my expertise
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

View 7 more Answers

Related Questions

What is Electronics ANd Communication Engineering?
ELectronics and Comm Engg is about the electronic design and how this can be applied in communication like mobile communication, antena, wave porpogation, signals logic design etc........
Maunish
How do I get into ISRO or DRDO after completing a BTech in ECE?
ISRO and DRDO conduct own exams and ISRO also calls for interview if you have good gate score, but for final selection interview is main. Most of the weightage for interview in ISRO and DRDO.
Shubham
0 0
7
Is it necessary to go to coaching or tuition for English in class 12 CBSE?
I think those students who are studying in a CBSE schools.They won't need.
Brahma
0 0
6
How does the transducer works?
Transducers used in electronic communications systems to convert signals of various physical forms to electronic signals, and vice versa. Example: microphone - it convert sound to electronic signal. speaker- it convert electronic signal to sound.
R
How can a BTech student get foreign internships?
Check for the foreign colleges online, their websites and procedure of admission, in that they provide all data regarding internships, also company provides some internships.
Pradeep
0 0
5

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

Ask a Question

Related Lessons

Introduction To Electric Drives
Drives are employed for systems that require motion control e.g. transportationsystem, fans, robots, pumps, machine tools, etc. Prime movers are required in drive systems toprovide the sources: diesel...

Review of Thermo
Which of the following process can be made reversible with the help of a regenerator? (A) Constant pressure process (B) Constant volume process (C) Constant pvn process (D) All of these Correct...

What Are the Differences Between Conventional Slab & Flat Slab?
Flat Slab:A flat slab is a slab with no drop beams. As the name sounds, think of it as a sheet of concrete, extending in all directions and supported on columns. That's it.In cases where the design loads...

Learning Path For Mobile Application Development
I. Traditional Approach: 1. Native Android Application Development: Android is a mobile operating system that runs on phones, tablets, smartwatches, TVs and more. You can learn Android Application Development...

Losses in a Transformer
The transformer is a Static device, i.e., It has no moving parts so by common sense it must have the highest efficiency among all the other electrical machines and also higher than that of rotating machines.The...

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 >

While schools provide formal education to the children, the home is where they start learning about things informally. Parents think that schools will take the initiative to educate their children. Well, this is partially true, as parents also play an essential role in bringing up their child. For the development of particular...

Read full article >

Once over with the tenth board exams, a heavy percentage of students remain confused between the three academic streams they have to choose from - science, arts or commerce. Some are confident enough to take a call on this much in advance. But there is no worry if as a student you take time to make choice between - science,...

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