diff --git a/charcount b/charcount index 3674d42..8407c3e 100755 Binary files a/charcount and b/charcount differ diff --git a/charcount.c b/charcount.c index a0fb403..90885cd 100644 --- a/charcount.c +++ b/charcount.c @@ -1,14 +1,17 @@ #include main (){ - int c, nb,nt,nl = 0; + int c = 0; while ((c = getchar()) != EOF) { - if(c='\0') - ++nb; - if(c='\t') - ++nt; - if(c='\n') - ++nl; + if(c==' ') + printf("blank "); + if(c=='\t') + printf("tab "); + if(c=='\n') + printf("newline\n"); + else + { + printf("%d",c); + } } - printf("\nThere are %d blanks, %d tabs, and %d new lines\n", nb,nt,nl); -} \ No newline at end of file +} \ No newline at end of file diff --git a/getchar b/getchar deleted file mode 100755 index 1f47047..0000000 Binary files a/getchar and /dev/null differ diff --git a/hello b/hello deleted file mode 100755 index af6608c..0000000 Binary files a/hello and /dev/null differ diff --git a/temperature b/temperature deleted file mode 100755 index 0e4fbe7..0000000 Binary files a/temperature and /dev/null differ