i'm just starting to learn C and i have a problem with displaying fractions.
My code:
insertWhen i run this, the ouput is:Code:#include<stdio.h> main() { float num = 2/3; printf("%f", num); getchar(); return 0; }
0.000000
How do i get it to output .666666??
Also, how would i get the output to display correct to 6 decimal places?
Thanx