{"id":2791,"date":"2024-06-26T11:17:33","date_gmt":"2024-06-26T11:17:33","guid":{"rendered":"https:\/\/odeacademy.in\/?p=2791"},"modified":"2024-06-26T11:17:33","modified_gmt":"2024-06-26T11:17:33","slug":"format-specifiers-in-c-programming-language","status":"publish","type":"post","link":"https:\/\/thequickknowledge.com\/exam\/format-specifiers-in-c-programming-language\/","title":{"rendered":"Format Specifiers in C Programming Language"},"content":{"rendered":"<p>h<\/p>\n<table class=\"GFGEditorTheme__table\">\n<thead>\n<tr>\n<th class=\"GFGEditorTheme__tableCell GFGEditorTheme__tableCellHeader\">\n<p dir=\"ltr\">Format Specifier<\/p>\n<\/th>\n<th class=\"GFGEditorTheme__tableCell GFGEditorTheme__tableCellHeader\">\n<p dir=\"ltr\">Description<\/p>\n<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td class=\"GFGEditorTheme__tableCell\">\n<p dir=\"ltr\" style=\"text-align: center;\"><b><strong>%c<\/strong><\/b><\/p>\n<\/td>\n<td class=\"GFGEditorTheme__tableCell\" style=\"text-align: center;\">For character type.<\/td>\n<\/tr>\n<tr>\n<td class=\"GFGEditorTheme__tableCell\">\n<p dir=\"ltr\" style=\"text-align: center;\"><b><strong>%d<\/strong><\/b><\/p>\n<\/td>\n<td class=\"GFGEditorTheme__tableCell\" style=\"text-align: center;\">For signed integer type.<\/td>\n<\/tr>\n<tr>\n<td class=\"GFGEditorTheme__tableCell\">\n<p dir=\"ltr\" style=\"text-align: center;\"><b><strong>%e or %E<\/strong><\/b><\/p>\n<\/td>\n<td class=\"GFGEditorTheme__tableCell\" style=\"text-align: center;\">For scientific notation of floats.<\/td>\n<\/tr>\n<tr>\n<td class=\"GFGEditorTheme__tableCell\" style=\"text-align: center;\">\n<p dir=\"ltr\"><b><strong>%f<\/strong><\/b><\/p>\n<\/td>\n<td class=\"GFGEditorTheme__tableCell\" style=\"text-align: center;\">For float type.<\/td>\n<\/tr>\n<tr>\n<td class=\"GFGEditorTheme__tableCell\">\n<p dir=\"ltr\" style=\"text-align: center;\"><b><strong>%g or %G<\/strong><\/b><\/p>\n<\/td>\n<td class=\"GFGEditorTheme__tableCell\" style=\"text-align: center;\">For float type with the current precision.<\/td>\n<\/tr>\n<tr>\n<td class=\"GFGEditorTheme__tableCell\">\n<p dir=\"ltr\" style=\"text-align: center;\"><b><strong>%i<\/strong><\/b><\/p>\n<\/td>\n<td class=\"GFGEditorTheme__tableCell\" style=\"text-align: center;\">Unsigned integer<\/td>\n<\/tr>\n<tr>\n<td class=\"GFGEditorTheme__tableCell\" style=\"text-align: center;\">\n<p dir=\"ltr\"><b><strong>%ld or %li<\/strong><\/b><\/p>\n<\/td>\n<td class=\"GFGEditorTheme__tableCell\" style=\"text-align: center;\">Long<\/td>\n<\/tr>\n<tr>\n<td class=\"GFGEditorTheme__tableCell\" style=\"text-align: center;\">\n<p dir=\"ltr\"><b><strong>%lf<\/strong><\/b><\/p>\n<\/td>\n<td class=\"GFGEditorTheme__tableCell\" style=\"text-align: center;\">Double<\/td>\n<\/tr>\n<tr>\n<td class=\"GFGEditorTheme__tableCell\">\n<p dir=\"ltr\" style=\"text-align: center;\"><b><strong>%Lf<\/strong><\/b><\/p>\n<\/td>\n<td class=\"GFGEditorTheme__tableCell\" style=\"text-align: center;\">Long double<\/td>\n<\/tr>\n<tr>\n<td class=\"GFGEditorTheme__tableCell\">\n<p dir=\"ltr\" style=\"text-align: center;\"><b><strong>%lu<\/strong><\/b><\/p>\n<\/td>\n<td class=\"GFGEditorTheme__tableCell\" style=\"text-align: center;\">Unsigned int or unsigned long<\/td>\n<\/tr>\n<tr>\n<td class=\"GFGEditorTheme__tableCell\" style=\"text-align: center;\">\n<p dir=\"ltr\"><b><strong>%lli or %lld<\/strong><\/b><\/p>\n<\/td>\n<td class=\"GFGEditorTheme__tableCell\" style=\"text-align: center;\">Long long<\/td>\n<\/tr>\n<tr>\n<td class=\"GFGEditorTheme__tableCell\">\n<p dir=\"ltr\" style=\"text-align: center;\"><b><strong>%llu<\/strong><\/b><\/p>\n<\/td>\n<td class=\"GFGEditorTheme__tableCell\" style=\"text-align: center;\">Unsigned long long<\/td>\n<\/tr>\n<tr>\n<td class=\"GFGEditorTheme__tableCell\">\n<p dir=\"ltr\" style=\"text-align: center;\"><b><strong>%o<\/strong><\/b><\/p>\n<\/td>\n<td class=\"GFGEditorTheme__tableCell\" style=\"text-align: center;\">Octal representation<\/td>\n<\/tr>\n<tr>\n<td class=\"GFGEditorTheme__tableCell\" style=\"text-align: center;\">\n<p dir=\"ltr\"><b><strong>%p<\/strong><\/b><\/p>\n<\/td>\n<td class=\"GFGEditorTheme__tableCell\" style=\"text-align: center;\">Pointer<\/td>\n<\/tr>\n<tr>\n<td class=\"GFGEditorTheme__tableCell\">\n<p dir=\"ltr\" style=\"text-align: center;\"><b><strong>%s<\/strong><\/b><\/p>\n<\/td>\n<td class=\"GFGEditorTheme__tableCell\" style=\"text-align: center;\">String<\/td>\n<\/tr>\n<tr>\n<td class=\"GFGEditorTheme__tableCell\" style=\"text-align: center;\">\n<p dir=\"ltr\"><b><strong>%u<\/strong><\/b><\/p>\n<\/td>\n<td class=\"GFGEditorTheme__tableCell\" style=\"text-align: center;\">Unsigned int<\/td>\n<\/tr>\n<tr>\n<td class=\"GFGEditorTheme__tableCell\">\n<p dir=\"ltr\" style=\"text-align: center;\"><b><strong>%x or %X<\/strong><\/b><\/p>\n<\/td>\n<td class=\"GFGEditorTheme__tableCell\" style=\"text-align: center;\">Hexadecimal representation<\/td>\n<\/tr>\n<tr>\n<td class=\"GFGEditorTheme__tableCell\" style=\"text-align: center;\">\n<p dir=\"ltr\"><b><strong>%n<\/strong><\/b><\/p>\n<\/td>\n<td class=\"GFGEditorTheme__tableCell\" style=\"text-align: center;\">Prints nothing<\/td>\n<\/tr>\n<tr>\n<td class=\"GFGEditorTheme__tableCell\">\n<p style=\"text-align: center;\"><b><strong>%%<\/strong><\/b><\/p>\n<\/td>\n<td class=\"GFGEditorTheme__tableCell\" style=\"text-align: center;\">Prints % character<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>j<\/p>\n","protected":false},"excerpt":{"rendered":"<p>h Format Specifier Description %c For character type. %d For signed integer type. %e or %E For scientific notation of floats. %f For float type. %g or %G For float type with the current precision. %i Unsigned integer %ld or %li Long %lf Double %Lf Long double %lu Unsigned int or unsigned long %lli or [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"disabled","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[1],"tags":[20,14],"class_list":["post-2791","post","type-post","status-publish","format-standard","hentry","category-new-post","tag-c-language","tag-computer-science"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/thequickknowledge.com\/exam\/wp-json\/wp\/v2\/posts\/2791","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thequickknowledge.com\/exam\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thequickknowledge.com\/exam\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thequickknowledge.com\/exam\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thequickknowledge.com\/exam\/wp-json\/wp\/v2\/comments?post=2791"}],"version-history":[{"count":1,"href":"https:\/\/thequickknowledge.com\/exam\/wp-json\/wp\/v2\/posts\/2791\/revisions"}],"predecessor-version":[{"id":2792,"href":"https:\/\/thequickknowledge.com\/exam\/wp-json\/wp\/v2\/posts\/2791\/revisions\/2792"}],"wp:attachment":[{"href":"https:\/\/thequickknowledge.com\/exam\/wp-json\/wp\/v2\/media?parent=2791"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thequickknowledge.com\/exam\/wp-json\/wp\/v2\/categories?post=2791"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thequickknowledge.com\/exam\/wp-json\/wp\/v2\/tags?post=2791"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}