- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What are Backslash character constants in C language?
A backslash ( \ ) that allows a visual representation of some nongraphic characters introduces an escape.
One of the common escape constants is the newline character (
).
Backslash Characters
The backslash characters are as follows −
Character | Meaning |
---|---|
‘\a’ | alert |
‘\b’ | backspace |
‘\f’ | form feed |
‘ ’ | newline |
‘\t’ | horizontal tab |
‘\r’ | carriage return |
‘\v’ | vertical tab |
‘\’ | backslash |
‘\’ ’ | single quote |
‘\" ’ | double quote |
‘\?’ | Question mark |
Example program
Following is the C program for the backslash character constants −
Example
#include<stdio.h> #define PI 3.14 float area; void main(){ double r; r=1.0; area = PI * r * r; printf("Area is %d
", area); // /n is used to enter the next statement in newline }
Output
Area is 1492442840
- Related Articles
- What are C++ Character Constants?
- What are different types of constants in C language?
- What are the constants with an example in C language?
- Difference between C++ string constants and character constants
- What are constants in C++?
- Character constants vs String literals in C#
- How to define character constants in C#?
- What are Enumerated Constants in C++?
- What are C++ Integer Constants?
- Data type of character constants in C and C++
- What are C++ Floating-Point Constants?
- What are different types of constants in C++?
- Explain the Character operations in C language
- What are Character Literals in C++?
- What are nested structures in C language?

Advertisements