
{"id":19030,"date":"2022-07-29T00:02:13","date_gmt":"2022-07-28T18:32:13","guid":{"rendered":"https:\/\/beautifulworknew.wordpress.com\/?p=19030"},"modified":"2022-07-29T00:02:13","modified_gmt":"2022-07-28T18:32:13","slug":"program-for-changing-case","status":"publish","type":"post","link":"https:\/\/www.trueangle.org\/index.php\/2022\/07\/29\/program-for-changing-case\/","title":{"rendered":"Program for  changing case"},"content":{"rendered":"\n<pre class=\"wp-block-preformatted\">$ls\nascii-table     avg.txt               env-var.c      functions_ver1.c  mph-to-kph_v2.c\nascii-table.c   avg-with-garbage.txt  env-var-set.c  functions_ver2.c  output.c\nascii-table.md  case-changer.c        exist.sh       mph-to-kph.c\n$gcc case-changer.c -o case-changer\n$.\/case-changer \ng\nG\nv\nV\nFF\nff\n$cat case-changer.c \n#include &lt;stdio.h&gt;\n#include &lt;string.h&gt;\n\nint main(void)\n{\n    char c[20] = { 0 };\n    char newcase[20] = { 0 };\n    int i;\n    while(fgets(c, sizeof(c), stdin) != NULL)\n    {\n        for(i=0; i&lt;=sizeof(c); i++)\n        {\n            \/* Upper case to lower case *\/\n            if ( (c[i] &gt;= 65) &amp;&amp; (c[i] &lt;= 90) )\n            {\n                newcase[i] = c[i] + 32;\n            }\n            \/* Lower case to upper case *\/\n            if ( (c[i] &gt;= 97 &amp;&amp; c[i] &lt;= 122) )\n            {\n                newcase[i] = c[i] - 32;\n            }\n        }\n        printf(\"%s\\n\", newcase);\n        \/* zero out the arrays so there are no\n           left-overs in the next run *\/\n        memset(c, 0, sizeof(c));\n        memset(newcase, 0, sizeof(newcase));\n    }\n    return 0;\n}\n$ <\/pre>\n","protected":false},"excerpt":{"rendered":"<p>$ls ascii-table avg.txt env-var.c functions_ver1.c mph-to-kph_v2.c ascii-table.c avg-with-garbage.txt env-var-set.c functions_ver2.c output.c ascii-table.md case-changer.c exist.sh mph-to-kph.c $gcc case-changer.c -o case-changer $.\/case-changer g G v V FF ff $cat case-changer.c #include &lt;stdio.h&gt; #include &lt;string.h&gt; int main(void) { char c[20] = { 0 }; char newcase[20] = { 0 }; int i; while(fgets(c, sizeof(c), stdin) != NULL) { &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.trueangle.org\/index.php\/2022\/07\/29\/program-for-changing-case\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Program for  changing case&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/19030"}],"collection":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/comments?post=19030"}],"version-history":[{"count":0,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/19030\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/media?parent=19030"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/categories?post=19030"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/tags?post=19030"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}