الأجوبة
/*Write a C program to find the length of a string without using the library function*/
#include <stdio.h>
#include <string.h>
void main()
{
char str1[50];
int i, l = 0;
printf("\n\nFind the length of a string:\n ");
printf("-------------------------------------\n");
printf("Input a string : ");
scanf("%s", str1);
for (i = 0; str1[i] != '\0'; i++)
{
l++;
}
printf("The string contains %d number of characters. \n",l);
printf("So, the length of the string %s is : %d\n\n", str1, l);
}أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال