5674 Shares

C-programming switch case question?

C-programming switch case question? Topic: Case switch statement c program
June 19, 2019 / By Lavone
Question: when you are using a switch-case function, can only one value be set per case or can you set the switch value to a range. ex-- switch (c) {case 1
Best Answer

Best Answers: C-programming switch case question?

Jocosa Jocosa | 10 days ago
cases can only take on integral values. If have a condition that takes on a range you should consider an if-else-if construct. NB: It is a switch statement/construct not a function
👍 288 | 👎 10
Did you like the answer? C-programming switch case question? Share with your friends

We found more questions related to the topic: Case switch statement c program


Jocosa Originally Answered: C-programming switch case question?
cases can only take on integral values. If have a condition that takes on a range you should consider an if-else-if construct. NB: It is a switch statement/construct not a function
Jocosa Originally Answered: C-programming switch case question?
it would be spectacular in case you will be somewhat greater specific concerning the project. As in, what form of errors you're turning out to be to be. there is not any deliver jointly errors on or close to that line. there's a good judgment errors some strains above it, the place you ignore to interrupt after the branch.

Gail Gail
it would be spectacular in case you will be somewhat greater specific concerning the project. As in, what form of errors you're turning out to be to be. there is not any deliver jointly errors on or close to that line. there's a good judgment errors some strains above it, the place you ignore to interrupt after the branch.
👍 120 | 👎 8

Gail Originally Answered: BASIC! Python programming question?
Hi There You could try using a while true loop, e.g. while userInput = True: (your code here) userInput = False The loop will continue until "userInput" (an example variable name) is False. Good luck! Check out my youtube channel for basic tutorials: http://www.youtube.com/user/HayleyComputerNerd or search "HayleyComputerNerd"
Gail Originally Answered: BASIC! Python programming question?
confirm you have your code top indented, maximum python blunders aris from indentation, make effective its like this: x = 15 if (x/2)*2 == x: print 'Even (thats tabbed in the time of) I easily have tried that on my version of python and it works while indented. good success programming in python, its a brilliant langague, Matt

If you have your own answer to the question case switch statement c program, then you can write your own version, using the form below for an extended answer.