Advertisement
amrulHarahap

Program Menghitung Panjang String

Dec 19th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1. // Program Menghitung Panjang String
  2. // Task No.3 file 066-P03.pptx
  3. // Amrul Mubarak Harahap
  4. // 19T03 - 1901098
  5.  
  6. #include <iostream>
  7. #include <cstring>
  8. #include <string>
  9. using namespace std;
  10.  
  11. int main(){
  12.     string kalimat;
  13.     int panjang;
  14.  
  15.     cout << "Masukkan kalimat: ";
  16.     getline(cin, kalimat);
  17.     panjang = kalimat.length();
  18.  
  19.     cout << "Panjang kata dari " << kalimat << " = " << panjang << endl;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement