Team Emertxe
Strings and Storage
Classes
Assignment 4
Assignment 4
Assignment 4
WAP to implement itoa function
Assignment 4
WAP to implement itoa function
Input:
Assignment 4
WAP to implement itoa function
Input: Read the String
Assignment 4
WAP to implement itoa function
Input: Read the String
Output:
Assignment 4
WAP to implement itoa function
Input: Read the String
Output: ‘itoa()’ function should convert the integer
number into string.
Assignment 4
Example’s:
 Input: 246
Output: “246”
Assignment 4
Example’s:
itoa() “246”
246
Integer String
Assignment 4
How to implement itoa function?
 Input: 246
2 4 6
integer
Assignment 4
How to implement itoa function?
 Input: 246
2 4 6
integer
246
str
?
Assignment 4
How to implement itoa function?
 Get each digit from the input
integer 2 4 6
6 4 2
Assignment 4
How to implement itoa function?
 Convert each digit to character
2 4 6
6 4 2
integer
?
str 6
Assignment 4
How to implement itoa function?
 Convert each digit to character
2 4 6
6 4 2
integer
str 6
? ?
4
Assignment 4
How to implement itoa function?
 Convert each digit to character
2 4 6
6 4 2
integer
str 6
? ?
4
?
2
Assignment 4
How to implement itoa function?
 Reverse the characters
2 4 6
6 4 2
integer
str
6
? ?
4
?
2
246
Reverse the
characters
Assignment 4
Example’s:
 Input: +123
Output: “123”
Assignment 4
Example’s:
itoa() “123”
+123
Integer String
Assignment 4
How to implement itoa function?
 Input: +123
+ 1 2 3
integer
Assignment 4
How to implement itoa function?
 Input: +123
+ 1 2 3
integer
123
str
?
Assignment 4
How to implement itoa function?
 Get each digit from the input
integer + 1 2 3
3 2 1
Assignment 4
How to implement itoa function?
 Convert each digit to character
+ 1 2 3
3 2 1
integer
?
str 3
Assignment 4
How to implement itoa function?
 Convert each digit to character
+ 1 2 3
3 2 1
integer
str 3
? ?
2
Assignment 4
How to implement itoa function?
 Convert each digit to character
+ 1 2 3
3 2 1
integer
str 3
? ?
2
?
1
Assignment 4
How to implement itoa function?
 Reverse the characters
+ 1 2 3
3 2 1
integer
str
3
? ?
2
?
1
123
Reverse the
characters
Assignment 4
Example’s:
 Input: 23a7
Output: “23”
Assignment 4
Example’s:
itoa() “23”
23a7
Integer String
Assignment 4
How to implement itoa function?
 Input: 23a7
2 3 a 7
integer
Assignment 4
How to implement itoa function?
 Input: 23a7
2 3 a 7
integer
23
str
?
Assignment 4
How to implement itoa function?
 Get each digit from the input
integer 2 3 a 7
3 2
Assignment 4
How to implement itoa function?
 Convert each digit to character
2 3 a 7
3 2
integer
?
str 3
Assignment 4
How to implement itoa function?
 Convert each digit to character
2 3 a 7
integer
str 3
? ?
2
3 2
Assignment 4
How to implement itoa function?
 Reverse the characters
2 3 a 7
integer
str 23
Reverse the
characters
3 2
3
? ?
2
Assignment 4
Sample execution:-
Assignment 4
Sample execution:-
Assignment 4
Sample execution:-
Assignment 4
Sample execution:-
Assignment 4
Pre-requisites:-
Assignment 4
Pre-requisites:-
⮚Functions
Assignment 4
Pre-requisites:-
⮚Functions
⮚Pointers
Assignment 4
Pre-requisites:-
⮚Functions
⮚Pointers
Objective:-
Assignment 4
Pre-requisites:-
⮚Functions
⮚Pointers
Objective:-
To understand the concept of
⮚Functions
Assignment 4
Pre-requisites:-
⮚Functions
⮚Pointers
Objective:-
To understand the concept of
⮚Functions
⮚Pointers
Team Emertxe
Thank you

04_itoa.pdf