The weather diary has one letter a day in week: S sunny, R rainy, C cloudy. Count how many days of each; the line that prints them is already written.
Sunny 3, rainy 3, cloudy 1
#include <stdio.h>
int main(void) {
char week[] = "SRCSRRS";
int sunny = 0, rainy = 0, cloudy = 0;
for (int i = 0; week[i] != '\0'; i++) {
// your code here: by the letter, add 1 to sunny, rainy or cloudy
}
printf("Sunny %d, rainy %d, cloudy %d\n", sunny, rainy, cloudy);
return 0;
}
Run tries the examples. When they look right, Submit.