C examples for Data Type:Type Cast
Test automatic type conversions
#include <stdio.h> int main(void){ char ch;// ww w . j a v a2 s .co m int i; float fl; fl = i = ch = 'C'; printf("ch = %c, i = %d, fl = %2.2f\n", ch, i, fl); ch = ch + 1; i = fl + 4 * ch; fl = 2.0 * ch + i; printf("ch = %c, i = %d, fl = %2.2f\n", ch, i, fl); ch = 107; printf("Now ch = %c\n", ch); ch = 81.89; printf("Now ch = %c\n", ch); return 0; }