tr command!

suppose i have a file like

//file.c

main()
{
printf("pritf");
printf("nirpt");
printf("%p%r%i%n%t%f");
}

suppose i would like to convert all the instances of "printf" to "PRINTF", the command i issued was

$ cat file.c | tr 'printf' 'PRINTF' 

this is the output i got

//FIle.c

maIN()
{
PRINTF("PRITF");
PRINTF("NIRPT");
PRINTF("%P%R%I%N%T%F");
}

but that was not the output i wanted. this is the output i wanted

//file.c

main()
{
PRINTF("pritf");
PRINTF("nirpt");
PRINTF("%p%r%i%n%t%f");
}

because, neither "FIle.c" is printf, and yet it got effected by tr and neither "maIN()" is "printf" , yet it too was effected...

how do i make tr identify the entire string and then make it replace it with the desired string, instead of letting each instance of a character in the string replaced?

[SOLVED]

used sed -i s/printf/PRINTF/g filename instead...