{"id":148,"date":"2021-09-27T13:11:18","date_gmt":"2021-09-27T13:11:18","guid":{"rendered":"https:\/\/ethosspace.com\/programmers\/?p=148"},"modified":"2021-10-11T11:49:44","modified_gmt":"2021-10-11T11:49:44","slug":"c-program-to-find-length-of-string-with-or-without-function","status":"publish","type":"post","link":"https:\/\/ethosspace.com\/programmers\/c-program-to-find-length-of-string-with-or-without-function\/","title":{"rendered":"C Program to find length of string with or without function"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>\/\/Program Name: To find length of the string with and without function.\n\n#include&lt;stdio.h&gt;\n#include&lt;string.h&gt;\nvoid main()\n{\nchar str&#91;250]; \/\/to store entered string\nint cnt;  \/\/counter\n\nprintf(\"\\n\\tEnter a string to check length:\" );\ngets(str);\n\nfor(cnt = 0; str&#91;cnt] != '\\0'; ++cnt);\n\nprintf(\"\\n\\t Length of string without using function: %d\", cnt);\n\nprintf(\"\\n\\t Length of string with strlen function %d\",strlen(str));\n\n}<\/code><\/pre>\n\n\n\n<div style=\"height:25px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Output<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Enter a string to check length:Learning C\nLength of string without using function: 10\n\t Length of string with strlen function 10<\/code><\/pre>\n\n\n","protected":false},"excerpt":{"rendered":"<p>Output<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","footnotes":""},"categories":[6],"tags":[],"class_list":["post-148","post","type-post","status-publish","format-standard","hentry","category-c-language"],"aioseo_notices":[],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"sparkling-featured":false,"sparkling-featured-fullwidth":false,"tab-small":false},"uagb_author_info":{"display_name":"program45_-rt8nb","author_link":"https:\/\/ethosspace.com\/programmers\/author\/program45_-rt8nb\/"},"uagb_comment_info":0,"uagb_excerpt":"Output","_links":{"self":[{"href":"https:\/\/ethosspace.com\/programmers\/wp-json\/wp\/v2\/posts\/148","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ethosspace.com\/programmers\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ethosspace.com\/programmers\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ethosspace.com\/programmers\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ethosspace.com\/programmers\/wp-json\/wp\/v2\/comments?post=148"}],"version-history":[{"count":2,"href":"https:\/\/ethosspace.com\/programmers\/wp-json\/wp\/v2\/posts\/148\/revisions"}],"predecessor-version":[{"id":273,"href":"https:\/\/ethosspace.com\/programmers\/wp-json\/wp\/v2\/posts\/148\/revisions\/273"}],"wp:attachment":[{"href":"https:\/\/ethosspace.com\/programmers\/wp-json\/wp\/v2\/media?parent=148"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ethosspace.com\/programmers\/wp-json\/wp\/v2\/categories?post=148"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ethosspace.com\/programmers\/wp-json\/wp\/v2\/tags?post=148"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}