C Program to Determine the Unicode Code Point at a Given Index Last Updated : 04 Jul, 2022 Summarize Comments Improve Suggest changes Share Like Article Like Report Unicode is the encoding mechanism to assign a unique number to each character. The first 128 characters are assigned as ASCII value means Unicode and ASCII value for the first 128 characters is the same. The first 128 characters contain the English Alphabet, Digits, Special Characters, etc. ASCII values are different for uppercase English alphabets and lowercase alphabets. TypesStarting ValueEnding ValueUppercase Alphabets6590Lowercase Alphabets97122 From the table above one can understand that starting Uppercase letter i.e 'A' will have a value of 65 and ending at 'Z' with 90. Similarly lowercase 'a' is 97 and ends at 'z' with 122. The C language has an implicit mapping of the 'char' data type to int which uses these Unicode values or ASCII values. There are 2 ways to determine the unicode code point at a given index in C: Returning value at index after storing in "int" datatype.Using for Loop1. Returning value at index after storing in int datatype Below is the C++ program to determine Unicode code point at a given index: C // C++ program to determine unicode // code point at a given index #include <stdio.h> // Driver code int main() { char arr[10] = "GeEkS"; int index1 = 0, index2 = 1, index3 = 2, index4 = 3, index5 = 4, code; printf("The String is %s\n", arr); code = arr[index1]; printf("The Unicode Code Point At %d is:%d\n", index1, code); code = arr[index2]; printf("The Unicode Code Point At %d is:%d\n", index2, code); code = arr[index3]; printf("The Unicode Code Point At %d is:%d\n", index3, code); code = arr[index4]; printf("The Unicode Code Point At %d is:%d\n", index4, code); code = arr[index5]; printf("The Unicode Code Point At %d is:%d\n", index5, code); return 0; } OutputThe String is GeEkS The Unicode Code Point At 0 is:71 The Unicode Code Point At 1 is:101 The Unicode Code Point At 2 is:69 The Unicode Code Point At 3 is:107 The Unicode Code Point At 4 is:83Time Complexity: O(n) Space Complexity: O(2*n+1) = O(n)2. Using for loop If the string value is increased then it is not feasible to declare an individual variable for the index. Also if the string size is decreased then the fixed variables can give Out of Bound Error. To handle these situations we will use for loop to traverse the string and print the corresponding code point. Below is the C program to determine unicode code point at a given index: C // C program to determine the unicode // code point at a given index #include <stdio.h> // Driver code int main() { char arr[10] = "GeEkS"; int code; printf("The String is %s\n", arr); for (int i = 0; arr[i] != '\0'; i++) { code = arr[i]; printf("The Unicode Code Point At %d is:%d\n", i, code); } return 0; } OutputThe String is GeEkS The Unicode Code Point At 0 is:71 The Unicode Code Point At 1 is:101 The Unicode Code Point At 2 is:69 The Unicode Code Point At 3 is:107 The Unicode Code Point At 4 is:83Time Complexity: O(n)Space Complexity: O(1) Comment More infoAdvertise with us S sunnydrall Follow Improve Article Tags : C Programs C Language C Strings Programs Similar Reads C Programming Language Tutorial C is a general-purpose mid-level programming language developed by Dennis M. Ritchie at Bell Laboratories in 1972. It was initially used for the development of UNIX operating system, but it later became popular for a wide range of applications. Today, C remains one of the top three most widely used 5 min read Non-linear Components In electrical circuits, Non-linear Components are electronic devices that need an external power source to operate actively. Non-Linear Components are those that are changed with respect to the voltage and current. Elements that do not follow ohm's law are called Non-linear Components. Non-linear Co 11 min read Spring Boot Tutorial Spring Boot is a Java framework that makes it easier to create and run Java applications. It simplifies the configuration and setup process, allowing developers to focus more on writing code for their applications. This Spring Boot Tutorial is a comprehensive guide that covers both basic and advance 10 min read Class Diagram | Unified Modeling Language (UML) A UML class diagram is a visual tool that represents the structure of a system by showing its classes, attributes, methods, and the relationships between them. It helps everyone involved in a projectâlike developers and designersâunderstand how the system is organized and how its components interact 12 min read Backpropagation in Neural Network Back Propagation is also known as "Backward Propagation of Errors" is a method used to train neural network . Its goal is to reduce the difference between the modelâs predicted output and the actual output by adjusting the weights and biases in the network.It works iteratively to adjust weights and 9 min read 3-Phase Inverter An inverter is a fundamental electrical device designed primarily for the conversion of direct current into alternating current . This versatile device , also known as a variable frequency drive , plays a vital role in a wide range of applications , including variable frequency drives and high power 13 min read Polymorphism in Java Polymorphism in Java is one of the core concepts in object-oriented programming (OOP) that allows objects to behave differently based on their specific class type. The word polymorphism means having many forms, and it comes from the Greek words poly (many) and morph (forms), this means one entity ca 7 min read What is Vacuum Circuit Breaker? A vacuum circuit breaker is a type of breaker that utilizes a vacuum as the medium to extinguish electrical arcs. Within this circuit breaker, there is a vacuum interrupter that houses the stationary and mobile contacts in a permanently sealed enclosure. When the contacts are separated in a high vac 13 min read CTE in SQL In SQL, a Common Table Expression (CTE) is an essential tool for simplifying complex queries and making them more readable. By defining temporary result sets that can be referenced multiple times, a CTE in SQL allows developers to break down complicated logic into manageable parts. CTEs help with hi 6 min read Python Variables In Python, variables are used to store data that can be referenced and manipulated during program execution. A variable is essentially a name that is assigned to a value. Unlike many other programming languages, Python variables do not require explicit declaration of type. The type of the variable i 6 min read Like