{"id":2330,"date":"2024-11-06T11:41:22","date_gmt":"2024-11-06T11:41:22","guid":{"rendered":"https:\/\/itnotes.apjsoftwares.in\/?p=2330"},"modified":"2024-11-06T11:41:22","modified_gmt":"2024-11-06T11:41:22","slug":"explain-double-and-float-data-type","status":"publish","type":"post","link":"https:\/\/itnotes.apjsoftwares.in\/index.php\/2024\/11\/06\/explain-double-and-float-data-type\/","title":{"rendered":"Explain double and float data type"},"content":{"rendered":"\n<p>The doubles and floats are datatypes used to declare decimal type variables. They are similar, but doubles have 15 decimal digits, and floats only have 7.<\/p>\n\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">float marks = 97.5;<br>double num;<\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;stdio.h>\r\nint main() {\r\n  float f = 0.3;\r\n  double d = 10.67;\r\n  printf(\"Float value: %f\\n\", f);\r\n  printf(\"Double value: %f\\n\", d);\r\n  return 0;\r\n}\n<strong>\nOutput\r\nFloat value: 0.300000\r\nDouble value: 10.670000<\/strong>\r\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>The doubles and floats are datatypes used to declare decimal type variables. They are similar,&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[13],"tags":[],"_links":{"self":[{"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/posts\/2330"}],"collection":[{"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/comments?post=2330"}],"version-history":[{"count":1,"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/posts\/2330\/revisions"}],"predecessor-version":[{"id":2331,"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/posts\/2330\/revisions\/2331"}],"wp:attachment":[{"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/media?parent=2330"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/categories?post=2330"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/tags?post=2330"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}