I have this simple program that counts characters in a line as well as a specific character z and Z. I am trying to figure out the simplest way to output my results to a file "outfile.txt". any ideas?
printf("Enter string: ");
printf("The length of your sentence is %d characters long\n",len);
for(s = string; *s != '\0'; s++)
if((*s == 'z') || (*s == 'Z'))
printf("Number of z's in your sentence are %d",zcount);