write a program to find the length of a string without using string function.(in c++)
Answers
Answered by
0
The program output is also shown below.
- /*
- * C program to find the length of a string without using the.
- * built-in function.
- #include <stdio.h>
- void main()
- {
- char string[50];
- int i, length = 0;
Answered by
0
Answer:
#include<iostream>
#include<string.h>
using namespace std;
int main()
{
int i,count=0;
char ch[i];
cin>>ch;
for(i=0;ch[i]!='\0';i++)
{
count++;
}
cout<<"The length of string is "<<count;
return 0;
}
Explanation:
Length of the string is the number of characters present in the string
Similar questions