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

Area under the curve, Write a program to find the area under the curve y = ...

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b

Visual basic, a program to accept average, if average is 75 to 85 print it...

a program to accept average, if average is 75 to 85 print it out else bypass using counter. enter and process 5 records

Luminous jewels, Problem : Luminous Jewels - Polishing Necklace Byteland c...

Problem : Luminous Jewels - Polishing Necklace Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of v

Introduction of c, Discuss the saleint featuresand application of c

Discuss the saleint featuresand application of c

Load catalogue from file, Implement a menu driven real estate catalogue sys...

Implement a menu driven real estate catalogue system that allows users to perform various catalogue maintenance and search tasks.  You are only allowed to use the C programming la

Implement binary heap in c++?, A:BinaryHeap.h ------------ #ifndef BI...

A:BinaryHeap.h ------------ #ifndef BINARY_HEAP_H_ #define BINARY_HEAP_H_ #include "dsexceptions.h" #include "vector.h" // BinaryHeap class // CONSTRUCTION: wi

Array structure, We started off taking about input, output, CPU and memory ...

We started off taking about input, output, CPU and memory devices. Within C we need a method of storing large amounts of data in memory. We have used the idea of variables (pointer

How to define a structure, How to Define a Structure? Structure declara...

How to Define a Structure? Structure declarations are rather more complicated than array declarations, ever since a structure must be defined in terms of its individual members

Program of conversion from basic to user-defined variable, Conversion from ...

Conversion from Basic to User-Defined variable Consider the following example. class Distance                  {                   public  :

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