Hi im doing a program and i use DevC++, The error is this
[Error] expected unqualified-id before '{' token
but i cant fix it help :c
This is my code (sorry 4 my english)
/*
NOMBRE: DANNA
MATRICULA:
GRUPO: 404
CARRERA: INFORMATICA
PROGRAMA: DLCDP_GPO04_PR30
OBJETIVO: SUMA Y RESTA DE DOS NUMEROS CON CLASES IF
FECHA DE CREACION: 31.03.2020
DOCENTE:
*/
#include<conio.h>
#include<iostream>
using namespace std;
//INICIODEL PROGRAMA
//CLASE ARITMETICA
class Aritmetica
{
//VARIABLES GLOBALES
double result;
//PUBLICO
public:
void suma(double d, double a)
{
result=d+a;
cout<<"\n La suma sera de:"<<result<<endl;
cout<<"\n Presione alguna tecla para continuar…"<<endl;
getch ();
}
void resta (double d, double a)
{
result= d-a;
cout<<"\n La resta será de:"<<result<<endl;
getch(); // The error marks me here-----------------------------------------------
}
};
{
void main()
cout<<" \n Que opción deseas hacer?: "<<endl;
cin>>OPCION;
class Aritmetica h;
double a, b;
if(OPCION==1)
{
cout<<"\n Escribe el numero a sumar:"<<endl;
cin>>d;
cout>>"\ Escribe el segundo numero a sumar:"<<endl;
cin>>a;
h.suma (a , b)
}
else(OPCION==2)
{
cout<<"\n Escribe el primero numero a restar:<<endl";
cin>>d;
cout<<<<"\n Escribe el segundo numero a restar:"<<endl;
cin>>a;
h. resta (a,b)
}
}