I hope this Tutorial Resolved all of your Queries about How to Use Format Specifier in C Programming. SO using that Variable name we can call that Float variable.įloat c=3.5 means that we have specified 3.5 as our Float variable a value. float c=3.5 įloat used for creating Variables that can store floating Values (like 1.2/3.5) inside C Program, And float c means that we have created a Variable called c. SO using that Variable name we can call that Character variable.Ĭhar b=’z’ means that we have specified z as our Character variable a value. char b=’z’ Ĭhar used for creating Character Variables inside C Program, And char b means that we have created a Variable called b. Int a = 1 means that we have specified 1 as our integer variable a value. SO using that Variable name we can call that Integer variable. Int used for creating Integer Variables inside C Program, And int a means that we have created a Variable called a. So what ever we write between printf() inverted commas (” “) that will be printed on the output Screen int a=1 Printf() is used to print “character, string, float, integer,etc” to the output screen. They cant be used with constants or expressions. Increment and decrement operators can be used only with variables. ++x is same as x x + 1 or x + 1-x is same as x x - 1 or x - 1. These operators increment and decrement value of a variable by 1. When We Run our C program the execution Control Directly to the main() (main function) and gave us result in output. C has two special unary operators called increment (++) and decrement (-) operators. Main Function is the entry point of C program. Because All Of the C’s In build Functions are declared in File main() : #include is a Header file that includes Slandered (str) Input Output (IO) Library/File. Example 1:ĭ =programminghead Example (Explained): #include : Inside the printf() function’s strings we write the %d (Formate Specifier For Integers) and after the comma we write our Variable name. like it Export Or print the values where the Formate Specifier is Declared.
Here we first Declared The Variable (int) to store a Integer Value, Then We gave Our Variable name (a) and the value 5, After This we used Printf() function To print out values to Output Screenįormate Specifier work like a PlaceHolder.
But for Printing Variable’s data we have to Use Format Specifiers inside Printf() function’s String, and after the String we Write out Data Type Name/Variable’s Name and separates the String The The variable’s Value We Use Comma before Variable name To Print any Data To Output Screen We Use printf() Function. How to Use Format Specifier in C Programming