Chapter-5 (format specifier in c) | Code2night.com
Code2night
  • Home
  • Blogs
  • Guest Posts
  • Tutorial
  • Post Blog
  • Register
  • Login
  1. Home
  2. Blogpost

Chapter-5 (format specifier in c)

Date- Dec 09,2023

3326

In C, format specifiers are used to specify the type of data being read or displayed when using functions like printf and scanf. These are a few frequently used C format specifiers:

Format Specifier:-

%d: Integer

%lg: double

%f: Float

%c: Character

%s: String

%p: Pointer

%x, %X: Hexadecimal (lowercase or uppercase)

%o: Octal

%u: Unsigned Integer

%e, %E: Scientific notation (lowercase or uppercase)

%g, %G: Uses %f or %e based on the value

%%: Percent sign

Here some of the format specifiers used in the below example in C:-

Example:-

#include<stdio.h>

#include<conio.h>

void main()

{

int a=10;double b=20;char c='a';char d[7]="code";float f=20.10;

clrscr();

printf("The value of integer is %d\n",a);

printf("The value of double is %lg\n",b);

printf("The value of character is %c\n",c);

printf("The value of String is %s\n",d);

printf("The value of float is %f\n",f);

getch();

}




Comments

Tags

Swagger UI
Swashbuckle
SwashbuckleAspNetCore
Rest API
Postman
Api Testing
ITextSharp
Export to Pdf
AspNet Core
AspNet
C#
View to Pdf in Aspnet
Scheduler
Fibonacci series in Java
Display Fibonacci Series
First C# Program
What is C?
C
C Programming
CodeLobster
Free Download for Youtube Subscribers!

First click on Subscribe Now and then subscribe the channel and come back here.
Then Click on "Verify and Download" button for download link

Subscribe Now | 1760
Download
Support Us....!

Please Subscribe to support us

Thank you for Downloading....!

Please Subscribe to support us

Continue with Downloading
Be a Member
Join Us On Whatsapp Join Us On Facebook

Welcome To Code2night, A common place for sharing your programming knowledge,Blogs and Videos

  • Panipat
  • info@Code2night.com

Links

  • Home
  • Blogs
  • Tutorial
  • Post Blog

Popular Tags

Copyright © 2026 by Code2night. All Rights Reserved

  • Home
  • Blog
  • Login
  • SignUp
  • Contact
  • Terms & Conditions
  • Refund Policy
  • About Us
  • Privacy Policy
  • Json Beautifier
  • Guest Posts