0% found this document useful (0 votes)
25 views68 pages

C Language

Uploaded by

P R Prasad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views68 pages

C Language

Uploaded by

P R Prasad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 68

‘C’ Programming

Made Simple & Easy to learn


Volume 1

1
MEMORIES
• STORAGE DEVICE - PRIMARY STORAGE
- SECONDARY STORAGE

• PRIMARY MEMORY – RAM


- ROM

• RAM – STATIC RAM


• - DYNAMIC RAM

2
MEMORIES
• ROM (READ ONLY MEMORY)
• PROM
• EPROM
• EEPROM

•SECONDARY MEMORIES – USED FOR BULK STORAGE

3
SOFTWARE
• SYSTEM SOFTWARE (Device drivers & OS)

• PROGRAMMING SOFTWARE – Tools to assist programmer


- Compilers, Debuggers, Interpreters,
Linkers, Text Editors

• APPLICATION SOFTWARE (CAD, PDF Reader etc)

4
COMPUTER ENVIRONMENT TYPES
• Personal Computing Environment

• Time-Sharing Environment

5
COMPUTER ENVIRONMENT TYPES
• Client-Server Environment

• Distributed Computing Environment

6
COMPUTER LANGUAGES

• Low Level Language – Machine Language (0’s & 1’s)

7
COMPUTER LANGUAGES

- Symbolic Language or Assembly Language


(ADD, SUB, JMP, INC etc)

Eg: MVI A,05


MVI B,03
ADD A,B
STA
HLT

8
COMPUTER LANGUAGES

• High Level Language – Format close to English language


- Write programs easily
- Contains English words &
mathematical symbols.
- Translates into machine language
before execution.

9
COMPUTER LANGUAGES

• High Level Language – According to their use the high level language
is classified into many types.
• Algebraic Formula-Type Processing.
• Business Data Processing
• String and List Processing
• Object Oriented Programming Language
• Visual programming language
10
HIGH LEVEL LANGUAGES

• Algebraic Formula-Type Processing – Computational procedures to


solve mathematical and statistical problems.
Eg: BASIC (Beginners All Purpose Symbolic Instruction Code).
FORTRAN (Formula Translation).
PL/I (Programming Language, Version 1).
ALGOL (Algorithmic Language).
APL (A Programming Language)

11
HIGH LEVEL LANGUAGES

• Business Data Processing – Maintaining data processing procedures


and files handling problems
Eg: • COBOL (Common Business Oriented Language).
• RPG (Report Program Generator)

12
HIGH LEVEL LANGUAGES
• String & List Processing – Manipulation including search for
patterns, inserting and deleting characters.
Eg: • LISP (List Processing).
• ProLog (Program in Logic)

• Object Oriented Programming Language: Program is divided into


objects
Eg: C++
JAVA
13
HIGH LEVEL LANGUAGES
• Visual programming language – These are designed for building
Windows-based applications .
Eg: • Visual Basic
• Visual Java
• Visual C

14
WHAT IS ‘C’ ?
• C is a programming language.
• Developed at AT & T‟s Bell Laboratories of USA in 1972.
• It was designed and written by Dennis Ritche.
• Dennis Ritchie is known as the founder of c language.

15
Features of ‘C’
• Machine Independent.
• Fast program Execution.
• Extendible Language.
• Structured Language

16
General Structure of ‘C’
/* Documentation section */ - Display info about program name etc
/* Link section */ - Inclusion of header files
- Defining Constants
/* Definition section */
- Global Variable declaration
/* Global declaration section */
main() main()
{ {
Declaration part Local Variable Declaration
Executable part (statements) Executable part (statements)
} }
/* Sub-program section */ /* Sub-program section */
17
First C Program
#include <stdio.h> Includes Standard I/O functions – printf()
#include <conio.h> Includes Console I/O function – getch()
void main() Main function – void refers no return value
{ {
printf("Hello C Language"); Print data on console
getch(); Asks for single character. Until you press a
} key, the screen is blocked.
}

18
C TOKENS
The smallest individual units are known as tokens. C has six types of
tokens.
1. Identifiers
2. Keywords
3. Constants
4. Strings
5. Special Symbols
6. Operators

19
C TOKENS - IDENTIFIERS
Identifiers: Identifiers refer to the names of variables, constants, functions and arrays.
These are user-defined names is called Identifiers. These identifier are defined against a
set of rules.
1. An Identifier can only have alphanumeric characters( a-z , A-Z , 0-9 ) &
underscore( _).
2. The first character of an identifier can only contain alphabet( a-z , A-Z ) or
underscore ( _).
3. Identifiers are also case sensitive in C. Eg: name and Name are two different
identifier in C.
4. Keywords are not allowed to be used as Identifiers.
5. No special characters other than underscore are permitted to be used Identifier.
6. C‟ compiler recognizes only the first 31 characters of an identifiers.
20
C TOKENS-Identifiers
Ex : Valid Invalid

STDNAME Return
SUB $stay
TOT_MARKS 1RECORD
_TEMP STD NAME.
Y2K

21
C TOKENS-Keywords
Keywords

• A keyword is a reserved word.

• All keywords have fixed meaning that means we cannot change.

• Keywords serve as basic building blocks for program statements.

• All keywords must be written in lowercase.

22
C TOKENS-Keywords
A list of 32 keywords in c language is given below:
auto break case char

const continue default do

double enum else extern

float for goto if

int long return register

signed short static sizeof

struct switch typedef union

unsigned void volatile while

Note: Keywords cannot be used as variable names


23
DATA TYPES
• To store data the program must reserve space which is done using
datatype.
• A datatype is a keyword/predefined instruction used for allocating
memory for data.
• A data type used for declaring/defining variables or functions of
different types before to use in a program.

24
DATA TYPES
• There are 4 types of data types

int array enum void


Char pointer
float structures
double union

25
PRIMARY DATA TYPES

•The basic data types are


integer-based and floating-
point based.

• C language supports both


signed and unsigned
literals.

•The memory size of basic


data types may change
according to 32 or 64 bit
operating system.

26
PRIMARY DATA TYPES
Type Size (bytes) Range Control
String
char or signed char 1 -128 to 127 %c

unsigned char 1 0 to 255 %c

int or signed int 2 -32768 to 32767 %d or %i float 4 %f or %g


unsigned int 2 0 to 65535 %u double 8 %lf
short int or signed 1 -128 to 127 %d or %i long double 10 %Lf
short int

unsigned short int 1 0 to 255 %d or %i

long int or signed 4 %ld


long int

27
VARIABLES
A variable is a name of memory
location. It is used to store data.

Variables are changeable, we can


change value of a variable during
execution of a program.

It can be reused many times.

Note: Variable are nothing but


identifiers.
28
RULES TO WRITE VARIABLE NAMES
• A variable name includes alphabets
and numbers, but it must start with
an alphabet.

• It cannot accept any special


characters, blank spaces except
under score( _ ).

• It should not be a reserved word.

29
DECLARATION OF VARIABLES
• A variable can be used to store a value of any data type. The declaration
of variables must be done before they are used in the program.

Syntax : data_type variable-1,variable-2,….., variable-n;


Variables are separated by commas & statement ends with a semicolon.

Example : int x,y,z;


float a,b; char m,n;

30
ASSIGNING VALUES TO VARIABLES
• Values can be assigned to variables using the assignment operator (=).
Syntax : variable = constant;
Example: x=100;
a= 12.25;
m=‟f‟;
• We can also assign a value to a variable at the time of variable declaration
Syntax : data_type variable = constant;
Example : int x=100;
float a=12.25;
char m=“f”;

31
TYPES OF VARIABLES IN C
• Local Variable: Defined inside the function and is limited to that function
only.

• Global Variable: Defined outside the function and is not limited to specific
function.

• Static Variable: A Static variable is able to retain its value between


different function calls. The static variable is only
initialized once, if it is not initialized, then it is
automatically initialized to 0
32
C TOKENS-Constants
Constants: Refers to fixed values that do not change during the
execution of a program
Types: Integer constants
Real or Floating point constants
Character constants
String Constants
Backslash character constants.

Note: constants are also called literals.


33
C TOKENS-Constants
• An integer constant is a numeric constant (associated with number) without
any fractional or exponential part.

• A floating point constant is a numeric constant that has either a fractional


form or an exponent form.

• A character constant is either a single alphabet, a single digit, a single special


symbol enclosed within single inverted commas.

•A string constant is a sequence of characters enclosed in double quote, the


characters may be letters, numbers, special characters and blank space etc
34
ESCAPE SEQUENCE OR BACKLASH CHARACTER
• \n newline
• \r carriage return
• \t tab
• \v vertical tab
• \b backspace
• \f form feed (page feed)
• \a alert (beep)
• \‟ single quote(„)
• \” double quote(“)
• \? Question mark (?)
• \\ backslash (\)
35
DEFINING A CONSTANT
The const keyword is used to define constant in C programming.
const float PI=3.14;
Now, the value of PI variable can't be changed.
#include <stdio.h>
#include <conio.h>
void main(){
const float PI=3.14;
printf("The value of PI is: %f”, PI);
getch();
}
Output:
The value of PI is: 3.140000
36
DEFINING A CONSTANT

The #define preprocessor is also used to define constant.


Syntax: #define token value
Let's see an example of #define to define a constant.
#include <stdio.h>
#define PI 3.14
main() {
printf("%f",PI);
}
Output:
3.140000
37
INPUT OUTPUT FUNCTIONS
• In „C‟ language, two types of Input/Output functions are available, and all input and
output operations are carried out through function calls.
• These functions are collectively known as the standard i/o library.

• Input: In any programming language input means to feed some data into program,
that is entering data.

• Output: In any programming language output means to display some data on


screen, printer or on any console.

38
INPUT OUTPUT FUNCTIONS
I / O Functions

Formated I/O Functions Unformated I/O Functions

Input Output
Input Output

scanf() print()
getc() putc()

fscanf() fprintf()
getchar() putchar()

gets() puts()

getch()

getche()

39
FORMATTED I/O FUNCTIONS
printf() : output data or result of an operation can be displayed from the computer to
a standard output device using the library function printf(). This function is used to
print any combination of data.
Syntax : printf(“control string “, variable1, variable2, , variablen);

Ex : printf(“%d”,3977); // Output: 3977

Syntax : printf(“fomating string”);


It prints all the character given in doublequotes (“ “) except formatting specifier.
Ex: printf(“ hello “);-> hello

40
FORMATTED I/O FUNCTIONS
scanf() : The scanf() function is used to read information from the standard input
device (keyboard)

Syntax : scanf(“control string “,&var1, &var2, , &varn);

Ex : scanf(“ %d “,&a);-> hello

Each variable name (argument) must be preceded by an ampersand (&). The (&)
symbol gives the meaning “address of “ the variable.

41
UNFORMATTED I/O FUNCTIONS
The unformatted I/O functions are of two types
• Character I/O
• String I/O

Character I/O:
• getchar(): Used to read a character from the standard input
• putchar(): Used to display a character to standard output
• getche() read and display the character
• getch() only read the single character but not display
• putch(): Used to display any alpha numeric characters to standard output

42
UNFORMATTED I/O FUNCTIONS
String I/O

gets(): Used for accepting any string from the standard input.

puts(): Used to display a string or character array

Cgets():read a string from the console

Cputs():display the string to the console

43
OPERATORS
An operator is a Symbol that Types of Operator :
performs an operation. Arithmetic Operators.
An operator acts on some variables Relational Operators.
called operands to get the desired Logical Operators.
result.
Assignment Operators.
Unary Operators.
Ex : a+b; Conditional Operators.
Where a,b are operands and + Special Operators.
is the operator
Bitwise Operators.
Shift Operators.

44
ARITHEMATIC OPERATORS
#include <stdio.h>
An arithmetic operator performs void main()
{
mathematical operations such as int a = 9,b = 4, c;
c = a+b;
addition, subtraction and multiplication printf("a+b = %d \n",c);
c = a-b;
on numerical values printf("a-b = %d \n",c);
c = a*b;
printf("a*b = %d \n",c);
c=a/b;
C Program to demonstrate the working of printf("a/b = %d \n",c);
arithmetic operators c=a%b;
printf("Remainder when a divided by b = %d \n",c);
}

45
RELATIONAL OPERATORS
• A relational operator checks the relationship between two operands. If the relation is true, it returns 1;
if the relation is false, it returns value 0.
• Operands may be variables, constants or expressions.
Operator Meaning Example Return value

< is less than 2<9 1

<= is less than or equal to 2<=2 1

> is greater than 2>9 0

>= is greater than or equal to 3>=2 1

== is equal to 2==3 0

!= is not equal to 2!=2 0

Relational operators are used in decision making and loops.

46
RELATIONAL OPERATORS
// C Program to demonstrate the working of Output
relational operators #include <stdio.h>
5 == 5 = 1
int main() 5>5=0
{
5 < 10 = 1
int a = 5, b = 5, c = 10;
5 != 5 = 0
printf("%d == %d = %d \n", a, b, a == b); // true
printf("%d > %d = %d \n", a, b, a > b); //false 5 <= 5 = 1
printf("%d < %d = %d \n", a, c, a < c); //true
printf("%d != %d = %d \n", a, b, a != b); //false
printf("%d <= %d = %d \n", a, b, a <= b); //true
return 0;
}
47
LOGICAL OPERATORS
The Logical Operators are used to combine the results of two or more conditions.
An expression containing logical operator returns either 0 or 1 depending upon whether
expression results true or false.

Operator Meaning Example Return value

&& Logical AND (9>2)&&(17>2) 1

|| Logical OR (9>2) || (17 = = 7) 1

! Logical NOT 29!=29 0

48
LOGICAL OPERATORS
Logical AND : If any one Logical OR : If any one Logical Not : This operator
condition false the complete condition true the complete reverses the value of the
condition becomes false. condition becomes true. expression it operates on i.e,
it makes a true expression
false and false expression
Op1 Op2 Op1 && Op2 Op1 Op2 Op1 // Op2 true.
true true true true true true
true false false true false true
false true false false true true
false false false Op1 Op1 !
false false false
true false
false true

49
LOGICAL OPERATORS
// C Program to demonstrate the working of logical Output
operators
#include <stdio.h> (a = b) && (c > b) equals to 1
int main()
(a = b) || (c < b) equals to 1
{
int a = 5, b = 5, c = 10, result; !(a == b) equals to 0
result = (a = b) && (c > b);
printf("(a = b) && (c > b) equals to %d \n", result);
result = (a = b) || (c < b);
printf("(a = b) || (c < b) equals to %d \n", result);
result = !(a == b);
printf("!(a == b) equals to %d \n", result);
return 0;
}
50
ASSIGNMENT OPERATORS
Assignment operators are used to assign a value Compound assignment operator:
(or) an expression (or) a value of a variable to
another variable. „C‟ provides compound assignment operators to
assign a value to variable in order to assign a new
value to a variable after performing a specified
Syntax : variable name=expression (or) value (or) variable operation.

Operator Example Meaning


Example: += x+=y x=x+y
x=10; -= x-=y x=x-y
y=a+b; *= x*=y x=x*y

z=p; /= x/=y x=x/y


%= x%=y X=x%y

51
ASSIGNMENT OPERATORS
Unary operators are having higher priority than other Pre-Increment
operators. Unary operators, meaning Pre-increment operator is used to increment the value of
variable before using in the expression. In the Pre-Increment
they only operate on a single operand.
value is first incremented and then used inside the expression.

Syntax: ++<variable name>;


Increment Operator in C Programming
• Increment operator is used to increment Post-Increment
the current value of variable by adding
integer 1. Post-increment operator is used to increment the value of
variable after executing expression completely. In the Post-
• Increment operator can be applied to only Increment value is first used in a expression and then
variables. incremented.

• Increment operator is denoted by ++. Syntax: <variable name>;

52
ASSIGNMENT OPERATORS
• // C Program to demonstrate the working of increment Output
and decrement operators
++a = 11
#include <stdio.h> --b = 99
int main() ++c = 11.500000
{ ++d = 99.500000
int a = 10, b = 100;
float c = 10.5, d = 100.5;
printf("++a = %d \n", ++a);
printf("--b = %d \n", --b);
printf("++c = %f \n", ++c);
printf("--d = %f \n", --d);
return 0;
}

53
ASSIGNMENT OPERATORS
Multiple increment operators inside printf Postfix and Prefix Expression in Same Statement
#include<stdio.h> #include<stdio.h>
void main() #include<conio.h>
void main()
{ {
int i = 1; int i = 0, j = 0; j = i++ + ++i;
printf("%d %d %d", i, ++i, i++); printf("%d\n", i);
printf("%d\n", j);
} }
Output : 3 3 1
Output :
2

54
ASSIGNMENT OPERATORS
Postfix and Prefix Expression in Same Statement
#include<stdio.h>
#include<conio.h>
void main()
{
int i = 0, j = 0; j = i++ + ++i;
printf("%d\n", i);
printf("%d\n", j);
}

Output :
2

55
CONDITIONAL (or) TERNARYOPERATORS
Conditional Operator checks the condition and executes the statement depending of the condition.
A conditional operator is a ternary operator, that is, it works on 3 operands.

Conditional operator consist of two symbols.


1 : question mark (?).
2 : colon ( : ).

Syntax : condition ? exp1 : exp2;


It first evaluate the condition, if it is true (non-zero)then the “exp1” is evaluated, if the condition is
false (zero) then the “exp2” is evaluated.

56
CONDITIONAL (or) TERNARYOPERATORS
#include <stdio.h> Output
int main() If this year is leap year, enter 1. If not enter
{ any integer: 1
char February; Number of days in February = 29
int days;
printf("If this year is leap year, enter 1. If not enter any integer: ");
scanf("%c",&February);
// If test condition (February == 'l') is true, days equal to 29.
// If test condition (February =='l') is false, days equal to 28.
days = (February == '1') ? 29 : 28;
printf("Number of days in February = %d",days);
return 0;
}

57
BIT WISE OPERATORS
Bitwise operators are used to manipulate the data Bitwise AND operator ‘&’
at bit level. It operates on integers only. It may not The output of bitwise AND is 1 if the corresponding bits of
be applied to float. two operands is 1. If either bit of an operand is 0, the result
of corresponding bit is evaluated to 0.
Operator Meaning
& Bitwise AND
Let us suppose the bitwise AND operation of two integers 12
| Bitwise OR
and 25.
^ Bitwise XOR
<< Shift left
12 = 00001100 (In Binary)
>> Shift right 25 = 00011001 (In Binary)
~ One‟s complement.
Bit Operation of 12 and 25 is

00001100
& 00011001

00001000 = 8 (In decimal)

58
BIT WISE OPERATORS
Bitwise OR operator | 00001100
The output of bitwise OR is 1 if at least one ^ 00011001
corresponding bit of two operands is 1. In C 00010101 = 21 (In decimal)
Programming, bitwise OR operator is denoted by |.
Bitwise OR Operation of 12 and 25
Bitwise complement operator ~
00001100 Bitwise compliment operator is an unary operator (works on
| 00011001 only one operand). It changes 1 to 0 and 0 to 1. It is denoted by
~.
00011101 = 29 (In decimal)
35 = 00100011 (In Binary)
Bitwise XOR (exclusive OR) operator ^ Bitwise complement Operation of 35
The result of bitwise XOR operator is 1 if the ~ 00100011
corresponding bits of two operands are opposite. It is 11011100
denoted by ^.
Bitwise XOR Operation of 12 and 25 For any integer n, bitwise complement of n will be -(n+1).

59
BIT WISE OPERATORS
#include <stdio.h> Output
int main()
Output = 8
{
Output = 29
int a = 12, b = 25;
printf("Output = %d \n", a&b);
Output=21
printf(“Output=%d \n”, a|b); Complement of a is=-13
printf(“Output=%d \n”,a^b); Complement of b is=-26
printf(“Complement of a is=%d \n”,~a);
printf(“Complement of b is=%d \n”,~b);
return 0;
}

60
SHIFT OPERATORS
There are 2 Bitwise shift operators in C programming:

Right shift operator


Left shift operator.

Right Shift Operator

Right shift operator shifts all bits towards right by certain number of specified bits. It is denoted by >>.

Left Shift Operator

Left shift operator shifts all bits towards left by certain number of specified bits. It is denoted by
<<.
61
SPECIAL OPERATORS
Comma Operator :The comma operator is used to Size of Operator : The sizeof() is a unary
separate the statement elements such as variables,
constants or expressions, and this operator is used operator, that returns the length in bytes o the
to link the related expressions together, such specified variable, and it is very useful to find
expressions can be evaluated from left to right and the bytes occupied by the specified variable in
the value of right most expressions is the value of
combined expressions the memory.

Ex : val(a=3, b=9, c=77, a+c)


Syntax : sizeof(variable-name);
First signs the value 3 to a, then assigns 9 to b, then
assigns 77 to c, and finaly80(3+77) to value. int a;
Ex : sizeof(a); //OUTPUT 4bytes

62
SPECIAL OPERATORS
#include <stdio.h> Output
int main() Size of int=4 bytes
{ Size of float=4 bytes
Size of double=8 bytes
int a, e[10]; float b; double c; char d;
Size of char=1 byte
printf("Size of int=%lu bytes\n",sizeof(a)); Size of integer type array having 10 elements = 40 bytes
printf("Size of float=%lu bytes\n",sizeof(b));
printf("Size of double=%lu bytes\n",sizeof(c));
printf("Size of char=%lu byte\n",sizeof(d));
printf("Size of integer type array having 10
elements = %lu bytes\n", sizeof(e)); return 0;
}

63
Expressions
An expression is a combination of operators and Algeberiac ‘C’
operands which reduces to a single value. An
operator indicates an operation to be performed on Expressions Expressions
data that yields a value. An operand is a data item 1 : ax2+bx+c 1: a*x*x+b*x+c
on which an operation is performed. 2 : a+bx 2 : a+b*x.
3 : 4ac/b 3 : 4*a*c/b.
Example: 4 : x2/y2-1 4 : x*x/y*y-1
3+5 is a simple expression which yields a value 8, -a
is also a single expression.
A complex expression contain more than one
operator.

64
Operator Precedence
Arithmetic Operators are evaluated left to right using
the precedence(Priority) of operator when the Example:
expression is written without the parenthesis. They are a=x-y/3+z*2+p/4.
two levels of priority. x=7, y=9, z=11, p=8.
a= 7-9/3+11*2+8/4.
1 : High Priority * / %
2 : Low Priority +- 1st phase :
1 : a = 7-3+11*2+8/4
Arithmetic Expression evaluation is carried out using the 2 : a = 7-3+22+8/4
two phases from left to right. 3 : a = 7-3+22+2

2nd phase :
First phase : The highest priority operator are evaluated
in the 1st phase. 1 : a = 4+22+2
Second Phase : The lowest priority operator are 2 : a = 26+2
evaluated in the 2nd phase. 3 : a = 28
65
Operator Precedence
Operator Description Precedence Associativity
The order of evaluation can be changed by putting + Unary plus 2 R-L (right to left)
parenthesis in an expression. - Unary minus
++ Increment
-- Decrement
! Not operator
Whenever parentheses are used, the expressions ~ Complement
Pointer operator
within parentheses highest priority. *
Address
&
sizeof operator
Sizeof operator
If two or more sets of parenthesis appear one after Conditional 13 R-L (right to left)
= *= /= %= += Assignment operator 14 R-L (right to left)
another. The expression contained in the left-most -= &= ^= <<=
set is evaluated first and the right-most in the last. >>=

66
Type Casting or Type Conversion
Type conversion is used to convert variable from one data Implicit Type Conversion
type to another data type, and after type casting complier
treats the variable as of new data type.
When the type conversion is performed automatically by the
compiler without programmers intervention, such type of
Syntax: (type_name) expression; conversion is known as implicit type conversion or type
promotion.
Without Type Casting:
main()
{
int f= 9/4; int x;
printf("f : %d\n", f ); for(x=97; x<=122; x++)
printf("%c", x);
}
With Type Casting:

float f=(float) 9/4;


printf("f : %f\n", f );

67
Type Casting or Type Conversion
Explicit Type Conversion Rules
All integer types to be converted to float.
The type conversion performed by the All float types to be converted to double.
programmer by posing the data type of the
All character types to be converted to integer.
expression of specific type is known as explicit
type conversion. The explicit type conversion is int x=7, y=5 ;
also known as type casting float z;
void main() z=x/y; /*Here the value of z is 1*/

{ int x=7, y=5;


float z;
int x; z = (float)x/(float)y; /*Here the value of z is 1.4*/
for(x=97; x<=122; x++)
printf("%c", (char)x); /*Explicit casting to char*/
}

68

You might also like