you know that each letter of the English alphabet has a decimal value, which can be found in any ascii chart, such as .this one. So, to solve your problem all you have to do is subtract the ascii value of 'a' from whatever the user input, then add 1 since you want the values from 1-26, not 0-25. For example, if you enter the letter 'b', the answer would be 'b' - 'a' + 1 = 98 - 97 + 1 = 2 Here is a program example
char n = '2';
int value = n - 'a' + 1;
You can now take the above one step further to apply it to the character array that you want. All you have to do is put that math algorithm in a loop .
So in your example if I enter the string "America" the program should output "gprs"?
In that case you need an array of 2d strings.
The above will give you 99 2d character arrays. Each string can have up to 100 characters.
stringlist = "America"
stringlist = "gprs"
stringlist = "France"
stringlist = "abc"
stringlist = "Germany"
stringlist = "def"
etc for each string
Now when someone enters "Germany", your program searches stringlist to stringlist for that text. When found, just output the value in stringlist[x] (assuming x is a loop counter 0-99)
So you are saying that the sequence of characters for array1 and array2 are already decided? In that case, your input string should be converted into a character array. Use a loop going through array1 to find the index of each character in the input, use that index to get the corresponding character from array2 and append that character to the output string.
Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...
I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...