CPP
Length of a String in C++
09 July
0
Write a program (WAP) in C++ to calculate length of a string.
#include <iostream>
using namespace std;
int main()
{
string str = "Sarthak Mund S3";
cout<<"String is : "<<str<<"\n";
cout << "Length of the String is : " << str.size();
return 0;
}
using namespace std;
int main()
{
string str = "Sarthak Mund S3";
cout<<"String is : "<<str<<"\n";
cout << "Length of the String is : " << str.size();
return 0;
}
Out Put :-
Must Read :-
Previous article
Next article
Leave Comments
Post a Comment