Write a program in C# Sharp to find the length of a string without using library function
- برمجة سي شارب
- برمجة
- 2021-05-30
- ahmadghneem
الأجوبة
using System;
public class Exercise2
{
public static void Main()
{
string str; /* Declares a string of size 100 */
int l= 0;
Console.Write("\n\nFind the length of a string :\n");
Console.Write("---------------------------------\n");
Console.Write("Input the string : ");
str = Console.ReadLine();
foreach(char chr in str)
{
l += 1;
}
Console.Write("Length of the string is : {0}\n\n", l);
}
}أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال