#include <stdio.h>
#include <c.h>

//int main (int argc, const char * argv[]);

switch (1066)
{
case 1066
printf( " Battle of Hastings");
break;

case 1492
printf( "columbus sailed to some place" );
break;

case 1776
printf( "The decleration of indipendence was written and signed")
break;

defult:
printf( "something happend but I forget what");



 

 return 0;}

//thats what isn't working pleze help me get it to work
//why is there a
//parse error before "switch"

Why is main commented out? and after you comment it out, why does it have a semicolon? And why are there no colons after each case statement? And why is default spelled wrong?

main was commented out to see if it was a missing or wrongly placed parentheses.

as for default being spelled wrong ( typo )
I fixed it but it still doesent work

#include <stdio.h>
#include <c.h>

int main (int argc, const char * argv[])

switch (1066)
{
case 1066
printf( " Battle of Hastings");
break;

case 1492
printf( "columbus sailed to some place" );
break;

case 1776
printf( "The declaration of independence was written and signed")
break;

default:
printf( "something happened but I forget what");



 

 return 0;}

Too lazy - here's the corrected code:

#include <stdio.h>
int main (int argc, char * argv[])
{
		switch (1066)
		{
		case 1066:
		printf( "Battle of Hastings\n");
		break;
		case 1492:
		printf( "columbus sailed to some place\n" );
		break;
		case 1776:
		printf( "The declaration of independence was written and signed\n");
		break;
		default:
		printf( "something happened but I forget what\n");
		}
 
return 0;
}
 
./Temp
Battle of Hastings

thanks
i was missing mainly
the concept of
:
and a ;
and a another { }
thanks

This article has been dead for over six months. Start a new discussion instead.