h1

program c++

October 16, 2009

program pertama… masi bingung convert nya ke c++ harap maklum….

1. //*love matchmaking program by dlurker*\\
2. #include <iostream>
3. #include <stdlib>
4. #include <time>
5. #include <conio>
6.
7. void menu()
8. {
9. char name_1[20];
10. char name_2[20];
11. cout<<"Insert your name [1..20] : "<<endl;
12. cin>>name_1;
13. cout<<"Insert name of the person you like :) [1..20] : "<<endl;
14. cin>>name_2;
15.
16. }
17.
18. void main()
19. {
20. srand((unsigned)time(0));
21.
22. char name_1[20];
23. char name_2[20];
24. int random =(rand()%100)+1;
25. menu();
26.
27.cout<<""<<name_1<<" dan "<<name_2<<" memiliki kesamaan"<<random<<"%"<<endl;
28.
29. getch();
30.
32. }

yup… masi ada salah karena name_1 dan name_2 sbg char kayanya ngga bisa dimasukin ke << << karena ngga ky random yg memiliki tipe integer

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: