Solution: Use sprintf() function.
You can also write your own function using ASCII values of numbers.
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- Convert a floating point number to string in C
- gcvt() | Convert float value to string in C
- How to convert C style strings to std::string and vice versa?
- Converting string to number and vice-versa in C++
- C program to count number of vowels and consonants in a String
- Print all possible combinations of the string by replacing '$' with any other digit from the string
- Print substring of a given string without using any string function and loop in C
- std::string::crbegin() and std::string::crend() in C++ with Examples
- How to find length of a string without string.h and loop in C?
- Convert C/C++ code to assembly language
- Program to Convert Hexadecimal to Octal
- Convert C/C++ program to Preprocessor code
- std::string class in C++
- C | String | Question 14
- Tokenizing a string in C++
- C | String | Question 13
- C | String | Question 16
- C | String | Question 15
- C | String | Question 4
- C | String | Question 3