bento Forum :: all that is in the visible Kingdom
Would you like to react to this message? Create an account in a few clicks or log in to continue.


Tempat berbincang, Mendapat Info, Aplikasi (Source Code), Software, Tips & Trik, Artikel dll.
 
IndeksPortalLatest imagesPencarianPendaftaranLogin
Pencarian
 
 

Display results as :
 
Rechercher Advanced Search
Navigation
 Portal
 Indeks
 Anggota
 Profil
 FAQ
 Pencarian
Latest topics
» [Share]WhoIs Web Services
Contoh-contoh program C/C++ EmptyMon Jan 03, 2011 12:30 am by whois

» atasi bandwidht yang dibatasi
Contoh-contoh program C/C++ EmptySun Jan 02, 2011 1:46 pm by whois

»  Software untuk melihat pemakaian Bandwith
Contoh-contoh program C/C++ EmptySun Jan 02, 2011 1:46 pm by whois

» Tutorial Web Hacking
Contoh-contoh program C/C++ EmptySun Jan 02, 2011 1:45 pm by whois

»  Membuat aplikasi HP dengan J2ME
Contoh-contoh program C/C++ EmptySun Jan 02, 2011 1:44 pm by whois

» Kode2 Rahasia Handphone
Contoh-contoh program C/C++ EmptySun Jan 02, 2011 1:44 pm by whois

» software generator virus free
Contoh-contoh program C/C++ EmptySun Jan 02, 2011 1:31 pm by whois

» 14 hacker terbaik dunia
Contoh-contoh program C/C++ EmptySun Jan 02, 2011 1:30 pm by whois

» Mengakali Website yang ter block oleh ISP (MENKOMINFO)
Contoh-contoh program C/C++ EmptySun Jan 02, 2011 1:29 pm by whois

Top posters
Admin
Contoh-contoh program C/C++ Vote_lcapContoh-contoh program C/C++ Voting_barContoh-contoh program C/C++ Vote_rcap 
whois
Contoh-contoh program C/C++ Vote_lcapContoh-contoh program C/C++ Voting_barContoh-contoh program C/C++ Vote_rcap 
dani
Contoh-contoh program C/C++ Vote_lcapContoh-contoh program C/C++ Voting_barContoh-contoh program C/C++ Vote_rcap 
dnazp
Contoh-contoh program C/C++ Vote_lcapContoh-contoh program C/C++ Voting_barContoh-contoh program C/C++ Vote_rcap 
ZzzOnly
Contoh-contoh program C/C++ Vote_lcapContoh-contoh program C/C++ Voting_barContoh-contoh program C/C++ Vote_rcap 
Social bookmarking
Social bookmarking reddit      

Bookmark and share the address of bentoforum on your social bookmarking website

Bookmark and share the address of bento Forum :: all that is in the visible Kingdom on your social bookmarking website
May 2024
MonTueWedThuFriSatSun
  12345
6789101112
13141516171819
20212223242526
2728293031  
CalendarCalendar
Statistics
Total 11 user terdaftar
User terdaftar terakhir adalah ipih

Total 62 kiriman artikel dari user in 39 subjects

 

 Contoh-contoh program C/C++

Go down 
2 posters
PengirimMessage
dani




Jumlah posting : 1
Join date : 20.11.10

Contoh-contoh program C/C++ Empty
PostSubyek: Contoh-contoh program C/C++   Contoh-contoh program C/C++ EmptySat Nov 20, 2010 8:25 pm

Bahasa pemrograman C merupakan salah satu bahasa pemrograman komputer. Dibuat pada tahun 1972 oleh Dennis Ritchie untuk Sistem Operasi Unix di Bell Telephone Laboratories.

Meskipun C dibuat untuk memprogram sistem dan jaringan komputer namun bahasa ini juga sering digunakan dalam mengembangkan software aplikasi. C juga banyak dipakai oleh berbagai jenis platform sistem operasi dan arsitektur komputer, bahkan terdapat beberepa compiler yang sangat populer telah tersedia. C secara luar biasa mempengaruhi bahasa populer lainnya, terutama C++ yang merupakan extensi dari C.

Berikut ini merupakan contoh-contoh program sederhana yang dibuat menggunakan bahasa pemrogaman C/C++.

Bilangan Faktorial
1. main() {
2. int i,n,hasil;
3. clrscr();
4.
5. printf("Masukkan bilangan faktor ?"); scanf("%i",n);
6. for(i=1;i<=n;i++) hasil=i*hasil;
7. printf("Faktor dari %i = %i",n,hasil);
8.
9. getch();
10. return(0);
11. }
Konversi Suhu
1. float kelvin(float c);
2. float fahrenheit(float c);
3. float reamur(float c);
4.
5. main() {
6. float c;
7. clrscr();
8.
9. //input suhu dalam C
10. printf("Masukkan suhu dalam satuan Celsius ?");
11. scanf("%f",&c);
Menghitung Nilai Pangkat
1. main() {
2. int i,n,hasil;
3. clrscr();
4.
5. printf("Masukkan nilai pangkat ?"); scanf("%i",n);
6. for(i=1;i<=n;i++) hasil=2*hasil;
7. printf("2 pangkat %i = %i",n,hasil);
8.
9. getch();
10. return(0);
11. }
Membuat Tampilan Menu
1. main() {
2. int i,n;
3.
4. for (i=1;i<=100;i++){
5. printf(">>>>>MENU UTAMA<<<<<\n\n");
6. printf("1. Tampil Menu 1\n");
7. printf("2. Tampil Menu 2\n");
8. printf("3. Tampil Menu 3\n");
9. printf("4. Tampil Menu 4\n");
10. printf("5. Exit");
11. printf("Pilih menu (1-4) ?");
12. scanf("%i",&n);
13. //perulangan dengan
14. switch() {
15. case 1:
16. printf("Anda memilih menu No.1\n");
17. break;
18. case 2:
19. printf("Anda memilih menu No.2\n");
20. break;
21. case 3:
22. printf("Anda memilih menu No.3\n");
23. break;
24. case 4:
25. printf("Anda memilih menu No.4\n");
26. break;
27. default:
28. printf("Anda memelih angka yang salah, silahkan masukkan 1-4!");
29. }
30. }
31.
32. getch();
33. return(0);
34. }
12.
13. //tampilan hasil konversi
14. printf("%8.2f Celcius adalah %8.2f Kelvin\n",c,kelvin(c));
15. printf("%8.2f Celcius adalah %8.2f Fahrenheit\n",c,fahrenheit(c));
16. printf("%8.2f Celcius adalah %8.2f Reamur\n",c,reamur(c));
17.
18. getch();
19. return(0);
20. }
21.
22. //konversi celcius ke kelvin
23. float kelvin(float c) {
24. float c;
25. return(c+275);
26. }
27.
28. //konversi celcius ke fahrenheit
29. float fahrenheit(float c) {
30. float c;
31. return(c*1.8+32);
32. }
33.
34. //konversi celcius ke reamur
35. float reamur(float c) {
36. float c;
37. return(c*0.Cool;
38. }
Menghitung nilai rata-rata
1. main() {
2. int i,n;
3. float rata,total,x;
4.
5. clrscr();
6. printf("Masukkan jumlah data ?");
7. scanf("%i",&n);
8.
9. for(i=1;i<=n;i++) {
10. printf("Data ke %i :",i);
11. scanf("%f",&x);
12. total+=x;
13. }
14.
15. rata=total/n;
16. printf("Rata-rata = %8.2f",rata);
17.
18. getch();
19. return(0);
20. }
Kembali Ke Atas Go down
Admin
Admin
Admin


Jumlah posting : 38
Join date : 02.11.10
Lokasi : bandung

Contoh-contoh program C/C++ Empty
PostSubyek: terima kasih artikel na bang .   Contoh-contoh program C/C++ EmptySat Nov 20, 2010 8:28 pm

sangat mambantu bang. bounce
Kembali Ke Atas Go down
https://bento.indonesianforum.net
 
Contoh-contoh program C/C++
Kembali Ke Atas 
Halaman 1 dari 1
 Similar topics
-
» MEMBUAT PROGRAM YANG DAPAT MENGCOPY DIRINYA OTOMATIS

Permissions in this forum:Anda tidak dapat menjawab topik
bento Forum :: all that is in the visible Kingdom :: Education :: Diskusi Pelajaran-
Navigasi: