Hello, just wondering if anyone could help with me a piece of code
Code:#include <stdio.h> #include <ctype.h> void step1() { printf("You have 3 choices\n"); printf("Enter a for Student Name\n"); printf("Enter b for Tutorial Time\n"); printf("Enter a number to display positives\n"); printf("Press q to quit\n"); scanf("%c", &letter); printf("Input = %c\n", letter); return; } void step2() { switch(response) { case 'a': printf("Name\n"); break; case 'b': printf("Date\n"); break; case 'c': case 'q': break; default: printf(“You haven't selected a valid option.\n”); } } while(response != 'q'); } int main() { char letter step1(); return(0); }
I need to display a menu then once the user inputs an option it goes on to step 2. Step 2 is a switch case scenario. Just wondering if I am on the right track?
also the scanf in step 1 doesn't work for some reason :/ it keeps coming up with an error.
Don't worry about case 'c' and such yet, I haven't started that section