Click here to Skip to main content
16,016,925 members

Comments by pcprincecharles (Top 1 by date)

pcprincecharles 22-Aug-11 9:54am View    
return keyword is not allowed in c#.
and i am telling the whole code find out where i am wrong

using System;
class sum
{
int a,b,c;
public void accept()
{
Console.WriteLine("Enter the first digit");
a=Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Enter the second digit");
b=Convert.ToInt32(Console.ReadLine());
calc(a, b);
}

public void calc(int firstValue, int secondValue)
{
c=Convert.ToInt32(a + b);
Console.WriteLine("no.is ",c);
}
}

class sum1
{
static void Main()
{
sum ob=new sum();
ob.accept();
sum ob1=new sum();
ob1.calc(2,3);

}
}