answersLogoWhite

0


Best Answer

The switch/case statement in the c language is defined by the language specification to use an int value, so you can not use a float value. You can, however, convert the float into an int and use it, so long as the resulting values and functionality meet your functional requirements.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

11y ago

#include

void SOMA(float a, int b); // Protótipo da função SOMA

void main()

{

float f;

f = 20.7

SOMA(16,f);

}

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How convert integer to float using switch case in c?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Can an integer be 3 and a half?

No, an integer cannot contain a decimal place. Instead consider using a double or a float for decimals.


How do you convert an integer into a text using C?

sprintf is the most common solution


How do you convert string to int in Java?

One can convert a string variable to an int variable in Java using the parse integer command. The syntax is int foo = Integer.parseInt("1234"). This line will convert the string in the parenthesis into an integer.


Is it possible to convert a string into integer without using any function in c?

Yes


How do you find by program a given number is integer or float?

If it contains a decimal point or an exponential part, then it should be handled as a float (or double).You can determine an existing variable's type in C using the type() function


How do you explain how an integer can be represented using BCD?

Explain how an integer can be represented using BCD?


Which keyword is used to declare constants and variable?

Constants are defines using the final keyword.Variables are defined using the one of the keywords:charbooleanintdoublelongintStringTo use a constant you would have to put in something likedouble final pi = 3.14;


Why you are using binary integer representation?

I am not!


How do you print size of integer?

the size of an integer is determaind by using the function "sizeof(c)",here 'c' is any integer.


If a polynomial cannot be factored using integer coefficients then it is?

In that case, it may, or may not, be possible to factor it using non-integer coefficients.


How do you subtract an integer with another integer without using a number line or counters?

gavin


How do you float in roblox using cheat engine?

Go down to type. Then select float.