This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

formatted output("back to c basic")

hi there
please here is the sample prog. code

#include stdio.h
#include conio.h

void main()
     {
     clrscr();
     float x=98.2344;
     printf("%2.2f",x);
     getch();
     }


so output of this prog.
is

98.23

upto here all thing's are ok
but it is possible to move or assing the float value
with limited number after decimal point;

for example in above prog if we are taking the new float variable new_x and moving the x to new_x i.e.
if x =98.2344
and i want to assign new_x = 98.23 or 98.2 or 98.234

0