Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
FloatInt
//gcc 7.4.0 //FloatInt: example of union //this code is created by Rezaul Hoque on March 31,2022;contact: jewelmrh@yahoo.com,Dhaka, Bangladesh //note: codes shared by Rezaul Hoque on rextester are not for sale; they are created and shared to facilitate the algorithm learning process; many like Hoque use this platform to practice programming ;Rezaul hopes his contribution helps others to fine tune their learning; #include <stdio.h> float intfloat(int); int floatint(float); float intfloat(int k) { union change{ int a; float f; }c; c.a=k; c.f=k/4; return c.f; } int floatint(float h) { union change{ int a; float f; }c; c.f=h; c.a=h*4; return c.a; } int main(void) { float b; int s; b=intfloat(8); printf ("8 is converted into %0.2f\n",b); s=floatint(8.00); printf ("8 is converted into %2d\n",s); return 0; }
run
|
edit
|
history
|
help
0
Null deref
18BCE2182 ASSESS_1 Q1-3
fibonacci1
linear hybrid cellular automaton utilizing rules 90 and 150 with period of (2^64)-1 for generating high quality random bits is reversible
ECE 2574 1/23
Prime no in given array
sjf
20171127_ARRAY_PRIMOS
Pregunta de función cantidad de digitos
Practica 5 fibonacci