Computer Science, asked by aishwaryasvidyanidhi, 17 days ago

write a program to find the length of a string without using string function.(in c++)​

Answers

Answered by ItsPrithvirajChauhan
0

The program output is also shown below.

  1. /*
  2. * C program to find the length of a string without using the.
  3. * built-in function.
  4. #include <stdio.h>
  5. void main()
  6. {
  7. char string[50];
  8. int i, length = 0;

Answered by asibulhasan23
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