Here is another that i get from Agus about C++ program. The question is look simple, but to make this program using C++, we need to know about member function that called getline. For more information about this function, please try to find using Google or directly open this site. And this is the example program that using getline() function on C++ and also the answer for Agus.
#include <iostream.h>
#include <conio.h>void main()
{
clrscr();
char name[100];
char address[200];
char birth_month[50];
int birth_year;
cout<<”Name : “;
cin.getline(name, sizeof(name));
cout<<”Address : “;
cin.getline(address, sizeof(address));
cout<<”Month of birth : “;
cin.getline(birth_month, sizeof(birth_month));
cout<<”Year of birth : “;
cin>>birth_year;
cout<<”Thank you, press any key to see the result…”<<endl;
getch();
clrscr();
cout<<”====================Your Biodata=====================”<<endl<<endl;
cout<<”Name : “<<name<<endl;
cout<<”Address : “<<address<<endl;
cout<<”Month of birth : “<<birth_month<<endl;
cout<<”Year of birth : “<<birth_year<<endl;
cout<<endl<<”=====================================================”<<endl;
getch();
}
Or you can download the C++ code here. Good luck.
13 Comment
even I’m still a newbie in coding -espc C++- but I can understand this cool tips. You’ve just explained well..
thank you
ouww.. its take value from an array .. isn it??
i have studied C and C# but C++ haven’t..
something like that, array of character
hmmn.. C++ ?
aku belum pernah belajar C++ bli…
bahasa C dan C# yang sudah
saya malah ga pernah tahu C dan C#, menurut buku sih katanya C++ itu pengembangan dari C.
gw taunya foxpro doank… baru juga ASP.net kmarin2 di training dari kantor… he..he…
kenapa nggak PHP aja
*biar bisa share
masih bingung sayah
bingung kenapa?
wow C++?? klo P++ (pijet plus plus) baru saya ngerti…. hehee
kok saya merasa ada yang terlalu merendah disini :p
ajari lagi donk C Pelus pelus
udah lupa nih
hahahaha, becanda ah bli ini
wah pak dosen bener2 seneng ma c++ yah… saya masih setia dengan .NET
ya begitulah, ini terpaksa buat ngajar algoritma
C++ ?? Kalo C+1+n+t+4 baru tau…. hee
hahahaha, becanda aja nih
Nah ni dia nih…. Siap-siap bantuin saya ya.
with my pleasure
huu huuu.. binun,
mendingan pake manual aja..
* tuiingg sok teu gw :P, mahap becanda
hehehe, no worry lah
kasi tau dong rumus C++ untuk menghitung frekuensi muncul-nya huruf dalam sebuah kalimat…. udah stuck b-g-t neh… pliss y…
please check here
[…] this post because I confuse how to describe about this post. As usually, I get questions about C++ here and I will try to answer as I can. The question is how to calculate the frequency of each letter […]
Leave a Reply