Float number, C/C++ Programming

Assignment Help:

We can combine more than one variable on the same line i.e.

  float number1,number2,number3; etc

Sometimes we want to mix the variable types used on the same line, this could cause problems, consider the following calculation

     C = a/10.0;

If the variable C is int, and a is float, the result of a/10.0 should produce a float. This can not be assigned in a variable C since C is of type int. Within C we can convert the variable types by use of force conversion (casting). i.e.

    C = (int) ( a/10.0) ;

  This forces the result of a/10.0 to become an integer which is the correct type for the variable C.


Related Discussions:- Float number

Array, write a function that take as parameters an array of integer and its...

write a function that take as parameters an array of integer and its size and return the sum of its value

#titletrees.., #question.conversion of tree into binary tree.

#question.conversion of tree into binary tree.

Asdas, Ask question #Miniasdasmum 100 words accepted#

Ask question #Miniasdasmum 100 words accepted#

Problem : Compiler Design - Limit the methods, Rahul is a newbie to the pro...

Rahul is a newbie to the programming and while learning the programming language he came to know the following rules: · Each program must start with ''{'' and end with '

Arrays, how to write the code for operation research

how to write the code for operation research

Padovan string, a padovan string p(n) for a natural number n is defined a...

a padovan string p(n) for a natural number n is defined as p(0)=''x'' p(1)=''y'' p(2)=''z'' p(n)=p(n-2)+p(n-3),n>2

What is token in programming languages, T o k e n :  Tokens  are  s...

T o k e n :  Tokens  are  small  entities  in  a  program.    Example: identifiers,  keywords,  constants, operators, strings, etc.  These tokens are used almost in same wa

Queue, write a queue program in c langauge?

write a queue program in c langauge?

#compiler design limiting instrutions, Ravi is a newbie to the programming ...

Ravi is a newbie to the programming and while learning the programming language he came to know the following rules: · Each program must start with ''''''''{'''''''' and end wi

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd