/* Count Spaces - Example */
/*This program counts tabs, spaces and newlines */
#include <stdio.h>
main()
{
int tabs; //Variables for tabs
int spaces; //Variables for spaces
int nl; //Variable for new lines
int c; //Variable for index variable
tabs = nl = spaces = c = 0; // All variables equall zero
while ((c=getchar()) != EOF) {
if (c == '/n') //If a new line
++nl;
if (c == '/t') // If a tab
++tabs;
if (c == ' ')
++nl;
} //End of while loop
//Print results
printf("Spaces/t Tabs/t New Lines\n");
printf("%d/t %d/t %d\n", spaces, tabs, nl);
}// End main function