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

Programming and solving problems, One person who is specialist at programmi...

One person who is specialist at programming and solving problems with a computer Project Description: Dear Potential computer, hardware, programming and software genius, I

Explain object-oriented programming, Explain Object-oriented programming ...

Explain Object-oriented programming Object-oriented programming (OOP) attempts to meet these requirements, providing methods for managing enormous complexity, achieving reuse o

Error handling and constructor, Provide me the answer, Can a constructor th...

Provide me the answer, Can a constructor throws an exception? How to handle the error when the constructor fails?

Type compatibility, Define  T y pe c o m p a t i b i li t y? ...

Define  T y pe c o m p a t i b i li t y? T o a s s i g n i n t t o s m a l l i n t t h e v a r i a b l e should b e

Illustrate the function definition, Illustrate the Function Definition? ...

Illustrate the Function Definition? The C code that explains what a function does is called the function definition. A function definition has the following form Type fun

Program decision making instructions, Within programs we very often want to...

Within programs we very often want to execute a different section of code, depending upon various conditions within C the If statement is used to achieve this. The If statement con

Gene program, Many human diseases could be controlled by the knowledge of t...

Many human diseases could be controlled by the knowledge of the gene’s structure and pattern. The human gene could be represented by four nucleotides. Each nucleotide is represente

Priority Queue, Ask question #Minimum 100 words acceptedEducational Objecti...

Ask question #Minimum 100 words acceptedEducational Objectives: After completing this assignment, the student should be able to accomplish the following: Apply generic algorithms i

Super ASCII String Cost, A string S is said to be "Super ASCII", if it cont...

A string S is said to be "Super ASCII", if it contains the character frequency equal to their ascii values. String will contain only lower case alphabets (''a''-''z'') and the asci

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