- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- 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
Advertisements