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.
#include
void SOMA(float a, int b); // Protótipo da função SOMA
void main()
{
float f;
f = 20.7
SOMA(16,f);
}
sprintf is the most common solution
Yes
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
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;
int num1 = 1; int num2 = 50; int addition = num1 + num2;
No, an integer cannot contain a decimal place. Instead consider using a double or a float for decimals.
sprintf is the most common solution
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.
Yes
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
Explain how an integer can be represented using BCD?
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;
I am not!
the size of an integer is determaind by using the function "sizeof(c)",here 'c' is any integer.
In that case, it may, or may not, be possible to factor it using non-integer coefficients.
gavin
Go down to type. Then select float.