Pelles C forum

C language => Beginner questions => Topic started by: Vegebond on August 11, 2010, 02:53:39 PM

Title: Illegal Statemetn Termination
Post by: Vegebond on August 11, 2010, 02:53:39 PM
I've been going round and round with this thing for a few hours. Maybe it's time for me to just pull over and ask for directions. What am I doing wrong here? I keep getting "Illegal Statement Termination".

While you're at it, show me how to count to ten and print the alphabet.


int main(int argc, char *argv[])
{
int x
for (x=0;x<5;x++) printf("Hello, world!\n") ;
return 0;
}

Title: Re: Illegal Statemetn Termination
Post by: frankie on August 11, 2010, 05:04:11 PM
int main(int argc, char *argv[])
{
int x;    //<=== missing semicolon
for (x=0;x<5;x++) printf("Hello, world!\n") ;
for (x=1;x<=10;x++) printf("Counting: %d\n", x) ;
for (x='a';x<='z';x++) printf("alphabet: %c\n", x) ;
for (x='A';x<='Z';x++) printf("ALPHABET: %c\n", x) ;
return 0;
}


Maybe you want to google around for a C programming tutorial.