| | Tolong contoh source codenya donnk.. | |
| | Author | Message |
---|
foreigner Moderator
Number of posts : 74 Age : 43 Location : Abepura, Jayapura, ID Points : 26 Registration date : 2008-06-07
| Subject: Tolong contoh source codenya donnk.. Sun Apr 26, 2009 4:09 pm | |
| Salam para pecinta C dan C++, mohon bantuannya bagi siapa yang ada contoh2 latihan c, mohon dipost di topic ini. Topic ini akan jadi bahan pembelajaran bagi teman2 kita yang ada di Universitas Victory, Terima kasih, GBU all | |
| | | cokiki Moderator
Number of posts : 263 Age : 36 Location : RUMPUT Points : 120 Registration date : 2008-06-18
| Subject: Re: Tolong contoh source codenya donnk.. Tue Apr 28, 2009 6:40 pm | |
| bro... saya punya tapi ada di website sya... di hiks-inc.biz bagian article trus source code.... semoga membantu... oo ia, besok mungkin baru on lagi websitenya... coz baru bayar hosting... | |
| | | CLiFF Administrator
Number of posts : 564 Age : 38 Location : Anywhere... Points : 10009 Registration date : 2008-06-03
| Subject: Re: Tolong contoh source codenya donnk.. Tue Apr 28, 2009 8:50 pm | |
| latihannya yang beginner or intermediate ??
or kira2 seperti yang dipelajari di computer programming 1&2 di UK ? | |
| | | jzt.nwbie Administrator
Number of posts : 529 Location : /home/jzt.nwbie Points : 109 Registration date : 2008-09-16
| Subject: Re: Tolong contoh source codenya donnk.. Sun May 03, 2009 1:15 am | |
| | |
| | | CLiFF Administrator
Number of posts : 564 Age : 38 Location : Anywhere... Points : 10009 Registration date : 2008-06-03
| Subject: Re: Tolong contoh source codenya donnk.. Wed May 06, 2009 6:38 am | |
| mungkin code dibawah ini bisa membantuMenampilkan Hello World - Code:
-
//hello world on screen //by Cliff #include <iostream.h>
main() { cout<<"HELLO WORLD"<<endl;
}
Hello Looping (for) - Code:
-
#include <iostream.h> #include <conio.h>
int x;
main() { for (x=1; x<=5; x++)
cout<<"hello"<<endl;
getch();
}
Menampilkan BIlangan Ganjil - Code:
-
//program bilangan ganjil
#include <iostream.h> #include <conio.h>
int i,x,mod;
main()
{ cout<<"input integer number <"; cin>>x;
for (i=1; i<x; i++) {mod=i%2; if (mod==1) {cout<<i<<" ";} } getch(); }
BIlangan Ganjil dan Genap - Code:
-
//program bilangan ganjil dan genap //by, pangkey, finecliff #include <iostream.h> #include <conio.h>
int i,x,mod; int pil;
main() { cout<<"-------------------------"<<endl; cout<<"BILANGAN GANJIL DAN GENAP"<<endl; cout<<"-------------------------"<<endl; cout<<"1. Bilangan Ganjil"<<endl; cout<<"2. Bilangan Genap"<<endl; cout<<"Pilihan (1 OR 2 then press enter):"; cin>>pil;
if (pil==1) {
cout<<"Bilangan Ganjil"<<endl; cout<<"Masukkan Angka <"; cin>>x; for (i=1; i<x; i++) { mod=i%2; if (mod==1) {cout<<i<<" ";} } } if (pil==2) { cout<<"Bilangan Genap"<<endl; cout<<"Masukkan angka <"; cin>>x; for (i=1; i<x; i++) { mod=i%2; if (mod==0) {cout<<i<<" ";} } } getch(); }
Penggunaan DO-WHILE untuk menampilkan bilangan bulat - Code:
-
#include <iostream.h>
#include <conio.h>
int i;
main()
{
cout<<"program menampilkan bilangan bulat"<<endl;
i=1;
do
{cout<<i<<" ";
i=i+1;}
while (i<=10);
getch();
}
Nested For (FOR bersarang) - Code:
-
//nested for/for bersarang //output program /*for x=1 for y=1 output=1 1
for x=2 for y=1 output=2 1 2 2
for x=3 for y=1 output=3 1 3 2 3 3
for x=4 for y=1 output=4 1 4 2 4 3 4 4 */
#include <iostream.h>
#include <conio.h>
main()
{
for (int x=1;x<=4;x++)
{for (int y=1;y<=x;y++)//nested for
{cout<<x<<" "<<y<<endl;}//nested for
}
getch();
}
FUNCTION - Code:
-
#include <iostream.h>
#include <conio.h>
void functionOne()
{cout<<"ini fungsi 1";}
void functionTwo()
{cout<<"ini fungsi 2";}
main()
{
int choice;
cout<<"MENU UTAMA";
cout<<"\n [1]. Panggil functionOne\a";
cout<<"\n [2]. panggil functionTwo\n";
cin>>choice;
if (choice==1){functionOne();}
else
{functionTwo();}
getch();
}
FUNCTION (Fungsi) untuk penjumlahan dan pengurangan - Code:
-
#include <iostream.h>
#include <conio.h>
int hasil;
void penjumlahan(int x,int y)
{hasil=x+y;
cout<<"hasil= "<<hasil;
}
void pengurangan(int x,int y)
{hasil=x-y;
cout<<"hasil= "<<hasil;
}
main()
{
int choice,a,b;
cout<<"MENU PROGRAM\n";
cout<<"[1].Penjumlahan 2 bilangan\n";
cout<<"[2].Pengurangan 2 bilangan\n";
do {cout<<"Masukan Pilihan anda [1] or [2]= "; cin>>choice;}
while (choice!=1&&choice!=2);
cout<<"input 1st number: ";cin>>a; cout<<"input 2nd number: ";cin>>b;
if (choice==1) {penjumlahan (a,b);}
else {pengurangan (a,b);}
getch (); }
FUNCTION untuk swap - Code:
-
#include <iostream.h>
#include <conio.h>
int a,b,temp;
void swap()
{
cout<<"PROGRAM SWAP TWO INTEGER NUMBER \a\n";
cout<<"\n";
cout<<"Input First Integer Number:";
cin>>a;
cout<<"\aInput Second Integer Number:";
cin>>b;
temp=0;
temp=a;
a=b;
b=temp;
cout<<"\n";
cout<<" AFTER SWAP:\n";
cout<<"\n";
cout<<"\n";
cout<<"\aFirst Integer Number:"<<a<<endl;
cout<<"Second Integer Number:"<<b<<endl;}
main()
{
{swap();}
getch();
}
TO BE CONTINUED...... | |
| | | cokiki Moderator
Number of posts : 263 Age : 36 Location : RUMPUT Points : 120 Registration date : 2008-06-18
| Subject: Re: Tolong contoh source codenya donnk.. Thu May 07, 2009 1:10 pm | |
| tambah nih.... yg keren codeproject.com tapi rata2 disitu udah advanced n kelas Visual semua... tapi pasti ada... di cari aja... | |
| | | Sponsored content
| Subject: Re: Tolong contoh source codenya donnk.. | |
| |
| | | | Tolong contoh source codenya donnk.. | |
|
Similar topics | |
|
| Permissions in this forum: | You cannot reply to topics in this forum
| |
| |
| May 2024 | Mon | Tue | Wed | Thu | Fri | Sat | Sun |
---|
| | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | | | Calendar |
|
Social bookmarking |
Bookmark and share the address of UNKLAB FORUM on your social bookmarking website |
|
Visitors | |
|