Hey, I'm trying to get this function to get the following output with the specified input, "..." is where I am not sure what to write:
void Question8(void)
{
char sentence[100];
int grade;
scanf(….);
printf("%s %d", sentence, grade);
}
Input:
My CS Grade is 1000
Output:
My CS Grade is 100
However, the kicker is what I need for scanf to read the c-string and then int with a single scanf command, is this possible?
Edit: I can only edit the code in a location with three periods ("..."), I can’t use anything else. I can assume that an input list is expected, but I can’t change anything beyond three periods. The output does not contain typos; the purpose of this assignment is to use flags and escape sequences.
source
share