I think you are using turbo C++ so at first I want to suggest you to use code::blocks IDE with minGW.Your code is older version of c++ latest version of c++ compiler does support void main() it must be return type.
you can use while loop in main function like this
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
int main()
{
char check='y';
while(check=='y')
{
AUTOMOBILES Nombor1;
Nombor1.masukNilai();
Nombor1.prosesKira();
Nombor1.paparHasil();
cout<<endl<<endl;
cout<<"Do you want to input another data:y/n "<<endl;
cin>>check;
}
return 0;
}
Don't forgot to change your header include form #include<iostream.h> to#include<iostream>
and also add usingnamespace std; below header include