Thursday, 9 April 2009

Syntax Highlighter Check

I installed SyntaxHighlighter by Alex Gorbatchev.
Since it uses javascript so to be able to see syntax highlighted code make sure that javascript is enabled for your browser e.g if you have Firefox with noscript, then add this site to whitelist.

Let's test some test code for python

#Sum n numbers
def sum_n(n):
return n*(n+1)/2

print sum_n(10)


and some test code for c


/* Calculates sum of n numbers */

int sum_n(int n)
{
return n*(n+1)/2;
}

int main()
{
int n;
printf("Enter n:");
scanf("%d",&n);
printf("\nSum : %d",sum_n(n));
return 0;
}


Let's see if it works.

No comments:

Post a Comment