Programming in C
Create an array of pointers that points to the names of the days of the week. Display the days using a loop.
So Far I have ( see below) but it fails
#include
int main()
{
char *DaysOW[] = {
"Monday", "Tuesday", "Wednesday", "Thursday",
"Friday", "Saturday","Sunday" };
int x;
for(x=0;x<7;x+);
printf("%s\n",DaysOW[x]);
return(0);
}
Still Need Help?
Join the QuestionCove community and study together with friends!
Sign Up
OpenStudy (rsmith6559):
I copied your code, correcting one error that I saw, and it worked fine. The error that I corrected, which I would expect the compiler would have caught, was in the for statement:
for( x = 0; x < 7; x+ ) /* should be x++ */
Computers don't do what you want, they do exactly what you tell them. Little stinkers!