error C2447: missing function header (old-style formal list?)

can someone help me how to solve this 1 error
error C2447: missing function header (old-style formal list?)
its pointing out the first curly bracket
please help me

#include<iostream.h>

int main();

{
int password;
for (int i=0;i<3;i++)

{cout <<"enter password:\n";
cin>>password;

if (password==123456)
{cout<<"correct!!!\n";
int a,b;
double s,m,t,d,r,c;
char more='y';
int option;
cout<<"\n";
cout<<" ***SAMPLE***\n";
cout<<"*** OPERATOR MACHINE***"<<endl;
cout<<"Choose a Operation:\n";
cout<<"\n";
cout<<"[1] ADDITION \n"
<<"[2] SUBTRACTION \n"
<<"[3] MULTIPLICATION \n"
<<"[4] DIVISION \n"
<<"[5] MODULUS REMAINDER \n"
<<"[6] QUIT \n"
<<"\n"
<<"Enter Option:";
cin>>option;
cout<<"Input Operation <a-e>:";
cin>> x;

switch(option)
{
case 1:
if (x=='a'){
cout<<"\n[[[ADDITION]]]\n";
cin>> a;
cout>>"Input number";
cin>> b;
s=a+b;
cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision(2);
cout<<"\n The sum is"<<s<<endl;}
break;
case 2:
if (x=='b') {
cout<<"\n[[[SUBTRACTION]]]\n";
cout<<"Input number: ";
cin>>a;
cout<<"Input number";
cin>>b;
m=a-b;


cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision(2);

cout<<"The diff is "<<m<<endl;}

continue;
case 3:
id (x=='c') {
cout<<"\n[[[MULTIPLICATION]]]\n";
cout<<"Input number: ";
cin>>a;
cout>>"Input number";
cin>>b;
t=a*b;

cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision(2);

cout<<"The product is "<<t<<endl;}

continue;
case 4:
if (x=='d') {
cout<<"\n***[[[DIVISION]]]***\n";
cout<<"Input number";
cin>>a;
cout<<"Input number";
cin>>b;
d=a/b;
cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision(2);
cout<<"The qoutient is"<<d<<endl;}

continue;
case 5:
if (x=='e') {
cout<<"\n***[[[MODULUS REMAINDER]]]***\n";
cout<<"Input number";
cin>>a;
cout<<"Input number";
cin>>b;
r=a%b;
cout<<"The modulus remainder is"<<r<<endl;}
else
cout<<"Invalid input";
while (more=='Y' || more=='y');
{/*begin while*/
cout<<"Input your number:";
cin>> a;
cout<<"Input a number:";
cin>> b;
c=a+b;
cout<<"The sum is"<<c<<"\n";
cout<<"Do you want to continue[y/n]";
cin>> more;
}/*end while */

continue;
case 6:
cout<<"\n***[[[EXIT MODE]]]***\n";


break;


default:
cout<<"\n That is an invalid option \n";
}






break;
}
else


cout<<"Pls try again!!!\n";}

return 0;
}//
Last edited on
int main(); // <--- Remove the ;
Topic archived. No new replies allowed.