home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
vol_300
/
353_02
/
typeconv.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
1992-01-19
|
645b
|
38 lines
// Chapter 2 - Program 5
#include <iostream.h>
main()
{
int a = 2;
float x = 17.1, y = 8.95, z;
char c;
c = (char)a + (char)x;
c = (char)(a + (int)x);
c = (char)(a + x);
c = a + x;
z = (float)((int)x * (int)y);
z = (float)((int)x * (int)y);
z = (float)((int)(x * y));
z = x * y;
c = char(a) + char(x);
c = char(a + int(x));
c = char(a + x);
c = a + x;
z = float(int(x) * int(y));
z = float(int(x) * int(y));
z = float(int(x * y));
z = x * y;
}
// Result of execution
//
// (There is no output from this program)