#include <iostream.h>
#include <conio.h>
double hasilnya(double bilangan, int banyak)
{
double jawaban;
jawaban=bilangan;
cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision(banyak);
return (jawaban);
}
int main()
{
int banyak;
double bilangan,hasil;
cout<<"Masukkan bilangan : ";
cin>>bilangan;
cout<<"Berapa banyak nilai desimal? ";
cin>>banyak;
hasil=hasilnya(bilangan,banyak);
cout<<"Bilangan sebelum dientri : " <<bilangan<<endl
<<"Bilangan sesudah dientri : " <<hasil<<endl;
getch ();
return 0;
}
is there any problems with my script?
i wanna make this project work correctly
when i type "Masukkan bilangan"(put numbers in): 1314232.321323313241
"Berapa banyak nilai desimal?"(how many decimal do you want?): 4
"Bilangan sebelum dientri"(the numbers before input): 1314232.3213 --> WRONG
"Bilangan sesudah dientri"(the numbers after input) : 1314232.3213 --> TRUE
how to correct 1314232.3213 become 1314232.321323313241 ??
i'm using borland C++
thanks b'4