i can't run my program bcoz of this error..

int main()

int x,y,z,r;
float a; 
char ch;
cout<<" enter amount";
cout<<" enter number of years to be paid";
cout<<" enter the rate"<<endl;
r= z/100;
cout<<" what would you like to compute?"<<endl;
cout<<" A = simple interest"<<endl;
cout<< " B = comppound interest"<<endl;
ch = toupper(ch);
if ( ch=='A')
a= x * ( 1 + ( r*y));
cout<<" simple interest amount = %f"<<a<<endl;
if (ch== 'B')
cout<<" what would be the rate?";
cout<<" 1 = annually"; 
cout<<" 2 = sime annual"; 
cout<<" 3 = quarterl"; 
cout<<" 4 = monthly"; 
e= r/b;
g= (1+ (e*y));
cout<<"compound amount with the interest = %f"<<a<<endl;
return 0;

Append the statement using namespace std; after the inclusion of the headers and you should be fine. This is because the C++ implementation wraps all the standard functions in a namespace std, so you have to make the compiler aware of that by using the "using namespace std;" statement.

Also if you are using new style of header inclusion, stick to it and don't mix the two techniques.

Also you positioning of braces is incorrect -- you have got them all skewed, you need to use the opening braces for writing function definations and not before them.

Do something like:

#include <iostream>
#include <cmath>
#include <cstring>
#include <iomanip>
using namespace std ;

int main( void )
   // code
This article has been dead for over six months. Start a new discussion instead.