Click To Get Off-Campus Placement Jobs Info !!!
Capgemini Recruitment Process 2020 – Updated Test Pattern and Selection Process in Details Latest Pattern !!
Program Discussion :: Strings
Home > Programs > Strings

74 / 58

Write an efficient program to find the length of a string.

Answer:

#include <iostream>

using namespace std;
int main()
{
    string str = "C++ Programming";
    /* you can also use str.length() */
    cout << "String Length = " << str.size();
    return 0;
}

Asked In ::

Post Your Answer Here:

Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here: