//Nama : Muhammad Zuhri
//NIM : 2016140614
//Kelas : 04TPLP011
//Tugas Akhir Struktur Data Pertemuan 5.cpp
#include <iostream>
#include <conio.h>
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
using namespace std;
int hitung (const char *);
main()
{
char string[80];
system ("COLOR 09");
cout<<"===========================PROGRAM FUNGSI DAN POINTER========================"<<endl;
cout<<"\nMenghitung banyaknya karakter yang diinput menggunakan fungsi dan pointer :"<<endl;
cout<<"\nKetikan kata/kalimat : ";
cin.getline(string,80);
cout<<"\nJumlah Karakter : "<<hitung(string)<<" Karakter";
return 0;
}
int hitung (const char*s)
{
int x=0;
for (;*s!='\0'; s++)
++x;
return x;
}
Hasil Outputnya seperti gambar dibawah ini :
Semoga materi struktur data ini bermanfaat bagi teman-teman yang membutuhkannya :)
Jumat, 01 Juni 2018
Home »
» Tugas Akhir Pertemuan 5 FUNCTION
Tugas Akhir Pertemuan 5 FUNCTION
Related Posts:
Tugas Akhir Pertemuan 12 STACK (Lanjut)//Nama : Muhammad Zuhri //NIM : 2016140614 //Kelas : 04TPLP011 //Tugas Akhir Struktur Data Pertemuan 12.cpp #include<iostream> #include<conio.h> using namespace std; m… Read More
Tugas Akhir Pertemuan 11 STACK//Nama : Muhammad Zuhri //NIM : 2016140614 //Kelas : 04TPLP011 //Tugas Akhir Struktur Data Pertemuan 11.cpp #include<stdio.h> #include<conio.h> int MAXSTACK; typedef i… Read More
Tugas Akhir Pertemuan 10 LINKED LIST//Nama : Muhammad Zuhri //NIM : 2016140614 //Kelas : 04TPLP011 //Tugas Akhir Struktur Data Pertemuan 10.cpp #include<iostream> #include<cstdlib> using namespace std; … Read More
Tugas Akhir Pertemuan 13 QUEUE//Nama : Muhammad Zuhri //NIM : 2016140614 //Kelas : 04TPLP011 //Tugas Akhir Struktur Data Pertemuan 13.cpp #include<iostream> #include<conio.h> #include<stdlib.h>… Read More
Tugas Pendahuluan Pertemuan 13 QUEUE Normal 0 false false false IN X-NONE X-NONE … Read More
kok berhenti sampe di ketikan kata/alamat ajah?:((
BalasHapus