Illegal Statemetn Termination

Started by Vegebond, August 11, 2010, 02:53:39 PM

Previous topic - Next topic

Vegebond

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;
}


frankie

#1
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.
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide