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

Memory management operator, Memory Management Operator In C malloc( ), ...

Memory Management Operator In C malloc( ), calloc( ), realloc( ), and free( ) are used to mange dynamic memory.  In addition to these function C++ have derived two unary ope

Result system, write a promgram using object oriented peramid

write a promgram using object oriented peramid

Programming and solving problems with a computer, One person who is special...

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

Differentiate between functions getch () and getche (), Differentiate betwe...

Differentiate between functions getch () and getche (). - Both functions accept a character input value from user. - When getch () is used, key that was pressed won't appear

Minimum shelf, At a shop of marbles, packs of marbles are prepared. Packets...

At a shop of marbles, packs of marbles are prepared. Packets are named A, B, C, D, E …….. All packets are kept in a VERTICAL SHELF in random order. Any numbers of packets with thes

Refactoring, Refactoring Project Description: TASK 1 - DESIGN ALGORIT...

Refactoring Project Description: TASK 1 - DESIGN ALGORITHM You are required to design a suitable solution algorithm by using structured chart, pseudocode or flowchart. Thi

Control flow, write the program to accept date and to say valid or invalid

write the program to accept date and to say valid or invalid

Input and output routines, Data is required to be fed into the program (inp...

Data is required to be fed into the program (input) and sent out of the program (output). Considering the draughtsman using a CAD station, the input is his commands to cause lines/

Define statements to define the constants, the problem description. The ...

the problem description. The order of the C Program should be as follows: Variables and constants Use #define statements to define the constants. Use arr

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