C

How to Print Double in C

In this tutorial, we are going to see how to print double in C. In C programming, the printf() function allows to display characters, string, float, integer, octal and hexadecimal on the output screen.

We use the printf() function with the format specifier %d to display the value of an integer variable. Similarly, %c is used to display a character, %f to display a float, %s to display a string, %lf to display a double and %x to display a hexadecimal value.
100-multiple-choice-questions-in-c-programming100 Multiple Choice Questions In C Programming – Part 1This collection of 100 Multiple Choice Questions and Answers (MCQs) In C Programming : Quizzes & Practice Tests with Answer focuses on “C Programming”.  …Read More

How to Print Double in C
#include <stdio.h>

int main()
{
   double d = 9.7456321;

   printf("Double value = %lf \n", d);

   return 0;
}

Output:

Double value = 9.745632

 

mcqMCQPractice competitive and technical Multiple Choice Questions and Answers (MCQs) with simple and logical explanations to prepare for tests and interviews.Read More

Leave a Reply

Your email address will not be published. Required fields are marked *