Write C++ program to find string length


techstudy.org

HP 15 Core i3 7th gen Laptop(4GB, 1TB HDD, Windows 10) | Rs. 31,490

Introduction

I have used CodeBlocks compiler for debugging purpose. But you can use any C++ programming language compiler as per your availability.


  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. string str = "Tech Study";
  7.  
  8. // you can also use str.length()
  9. cout << "String Length = " << str.size();
  10.  
  11. return 0;
  12. }
  13.  

Result

C++ language techstudy.org

     





Related Topics




Popular Posts