[On this Question they are asking assign the numbers to the letters][1]
Question:
Suppose that we assign the score 1 to character A, 2 to B, and 26 to Z by repeating the same rule. With the scores mapped by this rule, the sum of scores for “Luck’ is 47 (12 + 21 + 3 + 11), “Knowledge” is 96, “Hardwork” is 98, and “Attitude” is 100. Complete the following program which computes for an arbitrary string.
#include <stdio.h>
int main() {
char str[1000];
int i, score = 0;
scanf("%s", str);
for (i = 0; ______; ___)
{
int ch = str[i];
if (______________________) {
score += ____________;
}
else if (______________________) {
score += ____________;
}
}
printf("%d\n", score);
return 0;
}
Thanks in advance.