From 07d79564b50987de2cd784e420a641ff15291180 Mon Sep 17 00:00:00 2001 From: Mikita Sidarenka Date: Tue, 5 Apr 2022 11:46:11 +0000 Subject: [PATCH] Add 'du1/program.c' --- du1/program.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 du1/program.c diff --git a/du1/program.c b/du1/program.c new file mode 100644 index 0000000..447c1a5 --- /dev/null +++ b/du1/program.c @@ -0,0 +1,31 @@ +#include +#include +#include +#include +#include + +int main (){ + int c; + int counter; + counter=0; + c=getchar(); + while (1==1){ + if (c=='\n') + counter=counter+1; + if (c==EOF){ + return -1; + } + if ('a' <= c && c <= 'z') { + putchar(toupper (c)); + printf("\nPočet riadkov: %d\n",counter); + break; + } else{ + putchar(tolower (c)); + printf("\nPočet riadkov: %d\n",counter); + break; + } + + putchar (c); + assert (! ferror (stdin)); + return 0; + } \ No newline at end of file