I'm a beginner in C and currently in college. I got a task to make a simple alphabet decoder. I need to input 10 numbers in between 1 and 26, each number representing a letter of the alphabet. So 1 is A, 2 is B,... Z is 26.
int c1, c2, c3, c4, c5, c6, c7, c8, c9, c10;
scanf("%d %d %d %d %d %d %d %d %d %d", &c1, &c2, &c3, &c4, &c5, &c6, &c7, &c8, &c9, &c10);
I wrote this for the input, and now I was thinking of making a switch statement for each number, but it seems inpractical to have 10 switch statements. Is there any way for me to somehow make a switch statement that repeats for each input number in consecutive order?
switchstatement? The target/requirements keep moving in the comments also .. "not allowed to use functions",if,switch, and loops are allowed. The answer you accepted is forcing aswitchstatement, no one would ever write code like that. Can you please edit your question and add the assignment in its entirety?