**C TUTORIAL**

#

**C PROGRAMS**

C Basics

➤ Introduction to C

➤ Compile and Execute

➤ Hello, World! in C

➤ Identifiers & Keywords

➤ Data types in C

➤ Variables in C

➤ Comments in C

➤ Operators in C

➤ Bitwise Operators

➤ Printf() in C

➤ Input using scanf()

C Basic Programs

➤ Size & Range of Data Types

➤ C Programs for Beginners

➤ Add Subtract Multiply & divide

➤ Sum & Average of 3 Numbers

➤ Simple and Compound Interest

➤ Distance between two Points

➤ Find Circle Triangle Area

➤ ASCII Value of Character

➤ Find Square root of Number

➤ Different Swapping Programs

In this program, we will find ASCII value in C. C program to display the decimal value or ASCII value of a character. C program to find ASCII value in a given Range.

Prerequisites for writing all below programs:-

- Data types in C Programming language
- Operators in C Programming language
- Output formatting using printf() in C
- Input using scanf() in C

ASCII stands for American Standard Code for Information Interchange. ASCII was developed by the ANSI (American National Standards Institute). ASCII is used to interchange the information from a high-level language to low-level language. Machine or Computer understand only binary languages. So, the character data type represents integers.

```
#include<stdio.h>
int main()
{
char ch;
printf("Enter any character: ");
scanf("%c",&ch);
printf("ASCII value of %c is = %d",ch,ch);
return 0;
}
```

**Output:-**

Enter any character: S

ASCII value of S is = 83

Q) Display the decimal value or ASCII value in C of selected characters such as ‘A’, ‘a’, ‘0’, ‘l’, ‘K’, ‘z’, ‘Z’, ‘\0’, ‘\n’, ‘\t’.

## Find ASCII value in C in a given Range

```
#include<stdio.h>
int main()
{
int i, j; //i and j are two variables to store Range data
int k;
printf("Enter Range (i and j value such that i<j): ");
scanf("%d %d",&i, &j);
for(k=i; k<=j; k++)
{
printf("ASCII value of %d is= %c\n", k, k);
}
return 0;
}
```

Output:-

ASCII value of 0 is=

ASCII value of 1 is=

ASCII value of 2 is=

ASCII value of 3 is=

ASCII value of 4 is=

ASCII value of 5 is=

ASCII value of 6 is=

ASCII value of 7 is=

ASCII value of 8 is=

ASCII value of 9 is=

ASCII value of 10 is=

ASCII value of 11 is=

ASCII value of 12 is=

ASCII value of 13 is=

ASCII value of 14 is=

ASCII value of 15 is=

ASCII value of 16 is=

ASCII value of 17 is=

ASCII value of 18 is=

ASCII value of 19 is=

ASCII value of 20 is=

ASCII value of 21 is=

ASCII value of 22 is=

ASCII value of 23 is=

ASCII value of 24 is=

ASCII value of 25 is=

ASCII value of 26 is=

ASCII value of 27 is=

ASCII value of 28 is=

ASCII value of 29 is=

ASCII value of 30 is=

ASCII value of 31 is=

ASCII value of 32 is=

ASCII value of 33 is= !

ASCII value of 34 is= “

ASCII value of 35 is= #

ASCII value of 36 is= $

ASCII value of 37 is= %

ASCII value of 38 is= &

ASCII value of 39 is= ‘

ASCII value of 40 is= (

ASCII value of 41 is= )

ASCII value of 42 is= *

ASCII value of 43 is= +

ASCII value of 44 is= ,

ASCII value of 45 is= –

ASCII value of 46 is= .

ASCII value of 47 is= /

ASCII value of 48 is= 0

ASCII value of 49 is= 1

ASCII value of 50 is= 2

ASCII value of 51 is= 3

ASCII value of 52 is= 4

ASCII value of 53 is= 5

ASCII value of 54 is= 6

ASCII value of 55 is= 7

ASCII value of 56 is= 8

ASCII value of 57 is= 9

ASCII value of 58 is= :

ASCII value of 59 is= ;

ASCII value of 60 is= <

ASCII value of 61 is= =

ASCII value of 62 is= >

ASCII value of 63 is= ?

ASCII value of 64 is= @

ASCII value of 65 is= A

ASCII value of 66 is= B

ASCII value of 67 is= C

ASCII value of 68 is= D

ASCII value of 69 is= E

ASCII value of 70 is= F

ASCII value of 71 is= G

ASCII value of 72 is= H

ASCII value of 73 is= I

ASCII value of 74 is= J

ASCII value of 75 is= K

ASCII value of 76 is= L

ASCII value of 77 is= M

ASCII value of 78 is= N

ASCII value of 79 is= O

ASCII value of 80 is= P

ASCII value of 81 is= Q

ASCII value of 82 is= R

ASCII value of 83 is= S

ASCII value of 84 is= T

ASCII value of 85 is= U

ASCII value of 86 is= V

ASCII value of 87 is= W

ASCII value of 88 is= X

ASCII value of 89 is= Y

ASCII value of 90 is= Z

ASCII value of 91 is= [

ASCII value of 92 is= \

ASCII value of 93 is= ]

ASCII value of 94 is= ^

ASCII value of 95 is= _

ASCII value of 96 is= `

ASCII value of 97 is= a

ASCII value of 98 is= b

ASCII value of 99 is= c

ASCII value of 100 is= d

ASCII value of 101 is= e

ASCII value of 102 is= f

ASCII value of 103 is= g

ASCII value of 104 is= h

ASCII value of 105 is= i

ASCII value of 106 is= j

ASCII value of 107 is= k

ASCII value of 108 is= l

ASCII value of 109 is= m

ASCII value of 110 is= n

ASCII value of 111 is= o

ASCII value of 112 is= p

ASCII value of 113 is= q

ASCII value of 114 is= r

ASCII value of 115 is= s

ASCII value of 116 is= t

ASCII value of 117 is= u

ASCII value of 118 is= v

ASCII value of 119 is= w

ASCII value of 120 is= x

ASCII value of 121 is= y

ASCII value of 122 is= z

ASCII value of 123 is= {

ASCII value of 124 is= |

ASCII value of 125 is= }

ASCII value of 126 is= ~

ASCII value of 127 is=

ASCII value of 128 is = Ç

ASCII value of 129 is = ü

ASCII value of 130 is = é

ASCII value of 131 is = â

ASCII value of 132 is = ä

ASCII value of 133 is = à

ASCII value of 134 is = å

ASCII value of 135 is = ç

ASCII value of 136 is = ê

ASCII value of 137 is = ë

ASCII value of 138 is = è

ASCII value of 139 is = ï

ASCII value of 140 is = î

ASCII value of 141 is = ì

ASCII value of 142 is = Ä

ASCII value of 143 is = Å

ASCII value of 144 is = É

ASCII value of 145 is = æ

ASCII value of 146 is = Æ

ASCII value of 147 is = ô

ASCII value of 148 is = ö

ASCII value of 149 is = ò

ASCII value of 150 is = û

ASCII value of 151 is = ù

ASCII value of 152 is = ÿ

ASCII value of 153 is = Ö

ASCII value of 154 is = Ü

ASCII value of 155 is = ¢

ASCII value of 156 is = £

ASCII value of 157 is = ¥

ASCII value of 158 is = ₧

ASCII value of 159 is = ƒ

ASCII value of 160 is = á

ASCII value of 161 is = í

ASCII value of 162 is = ó

ASCII value of 163 is = ú

ASCII value of 164 is = ñ

ASCII value of 165 is = Ñ

ASCII value of 166 is = ª

ASCII value of 167 is = º

ASCII value of 168 is = ¿

ASCII value of 169 is = ⌐

ASCII value of 170 is = ¬

ASCII value of 171 is = ½

ASCII value of 172 is = ¼

ASCII value of 173 is = ¡

ASCII value of 174 is = «

ASCII value of 175 is = »

ASCII value of 176 is = ░

ASCII value of 177 is = ▒

ASCII value of 178 is = ▓

ASCII value of 179 is = │

ASCII value of 180 is = ┤

ASCII value of 181 is = ╡

ASCII value of 182 is = ╢

ASCII value of 183 is = ╖

ASCII value of 184 is = ╕

ASCII value of 185 is = ╣

ASCII value of 186 is = ║

ASCII value of 187 is = ╗

ASCII value of 188 is = ╝

ASCII value of 189 is = ╜

ASCII value of 190 is = ╛

ASCII value of 191 is = ┐

ASCII value of 192 is = └

ASCII value of 193 is = ┴

ASCII value of 194 is = ┬

ASCII value of 195 is = ├

ASCII value of 196 is = ─

ASCII value of 197 is = ┼

ASCII value of 198 is = ╞

ASCII value of 199 is = ╟

ASCII value of 200 is = ╚

ASCII value of 201 is = ╔

ASCII value of 202 is = ╩

ASCII value of 203 is = ╦

ASCII value of 204 is = ╠

ASCII value of 205 is = ═

ASCII value of 206 is = ╬

ASCII value of 207 is = ╧

ASCII value of 208 is = ╨

ASCII value of 209 is = ╤

ASCII value of 210 is = ╥

ASCII value of 211 is = ╙

ASCII value of 212 is = ╘

ASCII value of 213 is = ╒

ASCII value of 214 is = ╓

ASCII value of 215 is = ╫

ASCII value of 216 is = ╪

ASCII value of 217 is = ┘

ASCII value of 218 is = ┌

ASCII value of 219 is = █

ASCII value of 220 is = ▄

ASCII value of 221 is = ▌

ASCII value of 222 is = ▐

ASCII value of 223 is = ▀

ASCII value of 224 is = α

ASCII value of 225 is = ß

ASCII value of 226 is = Γ

ASCII value of 227 is = π

ASCII value of 228 is = Σ

ASCII value of 229 is = σ

ASCII value of 230 is = µ

ASCII value of 231 is = τ

ASCII value of 232 is = Φ

ASCII value of 233 is = Θ

ASCII value of 234 is = Ω

ASCII value of 235 is = δ

ASCII value of 236 is = ∞

ASCII value of 237 is = φ

ASCII value of 238 is = ε

ASCII value of 239 is = ∩

ASCII value of 240 is = ≡

ASCII value of 241 is = ±

ASCII value of 242 is = ≥

ASCII value of 243 is = ≤

ASCII value of 244 is = ⌠

ASCII value of 245 is = ⌡

ASCII value of 246 is = ÷

ASCII value of 247 is = ≈

ASCII value of 248 is = °

ASCII value of 249 is = ∙

ASCII value of 250 is = ·

ASCII value of 251 is = √

ASCII value of 252 is = ⁿ

ASCII value of 253 is = ²

ASCII value of 254 is = ■

ASCII value of 255 is =

If you enjoyed this post, share it with your friends. Do you want to share more information about the topic discussed above or you find anything incorrect? Let us know in the comments. Thank you!

**Similar Basic C programming examples**