1. printf(1+”%d”);
It starts printing the String Skipping the number of Characters specified before ‘+’ sign
2. Backslash Characters in C
- \n
- Newline [ Moves Cursor Position to Next Line ]
- \b
- Back Space [ Moves Cursor Position to 1 character Back ]
- \r
- Linefeed [ Moves Cursor Position to First Position in Same Line ]
1. #include<stdio.h>
2.
void main()
3.
{
4.
printf("\nDiicket");
5.
printf("\bter");
6.
printf("\rCr");
Outout : Cricket
3. Two Strings in Printf
Ex : printf("Computer","Programming")
1. Only First String Will be Accepted
2. If number of Strings are Seperated by "Comma" then it will accept only
first Stringf
4. %d format specifier
printf("%d %d %d",50,050,0x50);Output:50 40 80
why?
- Any number preceded with Zero
(040,050,030) are considered as Octal Numbers
- Any number preceded with [ 0x / 0X ] (0x40,0x50,0x30) are considered as Hexadecimal Numbers
5. Printf inside printf in C
printf("%d",printf("%d",printf("%d",num)));
Output: 134241
Printf Returns total number of Digits
No comments:
Post a Comment