using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for Calculator
/// </summary>
/// 


public class Calculator
{

    public double Add(double a, double b)
{
       return a + b;
}
    public double Subtract(double a, double b)
    {
        return a - b;
    }
    public double Multiply(double a, double b)
    {
        return a * b;
    }
    public double Divide(double a, double b)
    {
        return a / b;
    }
}

getting error 'Type or namespace definition, or end-of-file expected'
and
Unexpected character '−'

Member Avatar for LastMitch

getting error 'Type or namespace definition, or end-of-file expected'

There's nothing wrong with the code. Was there more to it?

How are you initiating a class and adding parameter values?

yea there was no error in code actually VS 2012 was giving errors and when i restarted it errors were gone.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.