write a program to find the length of a string without using string function.(in c++)
Answers
Answered by
0
Explanation:
#include<iostream>
#include<string.h>
using namespace std;
int main()
{
int i,count=0;
char ch[50];
cout<<"\nEnter any string :: ";
cin>>ch;
for(i=0;ch[i]!='\0';i++)
{
count++;
}
cout<<"\nLength of String [ "<<ch<<" ] is :: "<<count<<"\n";
return 0;
HOPE IT HELPSS!
Answered by
0
Answer:
Refer below
Explanation:
#include <iostream>
using namespace std;
int main()
{
char s[100];
int i;\
cout << “\nEnter a string: “;
cin >> s;
for(i = 0; s[i] != ‘\0’; ++i);
cout << “\nLength of string : ” << i;
cout << endl;
return 0;
}
Similar questions