GeeksforGeeks » C/C++ Programming Questions

printing

(2 posts)

Tags:

  1. pranav
    guest
    Posted 4 months ago #

    how to print 2.3 instead of 2.300000 float type without using .1f;...........

  2. kartik
    Moderator
    Posted 4 months ago #

    int main()
    {
      float x = 2.3;
      printf("%1.1f", x);
      return 0;
    }
    

Reply

You must log in to post.

RSS feed for this topic