Error in AWK Program

Hi Friends,
I need your help.

I am not able to execute one awk program .If you can solve the following small program
then i can solve other one.

$ vi prg

#!/bin/awk -f
BEGIN {

# Print the squares from 1 to 10 the first way

    i=1;
    while \(i <= 10\) \{
            printf\( "The square of ", i, " is ", i*i\);
            i = i\+1;
    \}

# now end
exit;
}

then i made chmod 777 prg

when i execute like
$prg
The square of The square of The square of The square of The square of The square of The square of The square of The square of The square of $

its coming like this.

Please let me know where i have done the mistake.

Thanks in advance
Bikas

Add the missing %i's for printing the num & its square...

printf( "The square of %i is %i\n", i, i*i)

Hi.

Or remove the "f" from "printf" -> "print" ... cheers, drl

Thanks a lot frnds.
I change it to print from printf and its working.

:b: