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

 Live Demo

#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
Updated on: 2021-03-08T07:06:32+05:30

5K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements