Count number of characters in string - C++

Q. Write a C++ program to count no. of characters in a string without using standard function.

Answer:

#include<iostream>
#include<stdio.h>
using namespace std;

int main()
{
        char str[1000];
        int l=0;

        cout<<"\n Enter String : ";
        cin>>str;

        for(int i=0; str[i] != '\0'; ++i)
        {
                l++;
        }
        cout<<"\n Length of the String is : "<<l;

        return 0;
}


Output:

count characters without using standard function