
using System;
namespace AddMinusDivideMultiply
{
class Program
{
public static int i, j;
public static void Main()
{
Console.Write("Please Enter The First Number :");
string temp = Console.ReadLine();
i = Int32.Parse(temp);
Console.Write("Please Enter The Second Number :");
temp = Console.ReadLine();
j = Int32.Parse(temp);
[COLOR=Red][B]
Minuz.minus();[/B][/COLOR] // Here its generating an Error - Error 1 The name 'Minuz' does not exist in the current context
}
}
class Terms
{
public static void Add()
{
int add;
add = Program.i + Program.j;
Console.WriteLine("The Addition Of The First and The Second Number is {0}", add);
}
class Minuz
{
public static void Minus()
{
int minus;
minus = Program.i - Program.j;
Console.WriteLine("The Subraction Of The First and The Second Number is {0}", minus);
}
}
}
}

TΞΞNSTAR™;6834256 said:Guys Another Prob
I Want to call a class into the Main method.. And im getting this error :s
Code:using System; namespace AddMinusDivideMultiply { class Program { public static int i, j; public static void Main() { Console.Write("Please Enter The First Number :"); string temp = Console.ReadLine(); i = Int32.Parse(temp); Console.Write("Please Enter The Second Number :"); temp = Console.ReadLine(); j = Int32.Parse(temp); [COLOR=Red][B] Minuz.minus();[/B][/COLOR] // Here its generating an Error - Error 1 The name 'Minuz' does not exist in the current context } } class Terms { public static void Add() { int add; add = Program.i + Program.j; Console.WriteLine("The Addition Of The First and The Second Number is {0}", add); } class Minuz { public static void Minus() { int minus; minus = Program.i - Program.j; Console.WriteLine("The Subraction Of The First and The Second Number is {0}", minus); } } } }
it should be
Minuz.Minus();
and i guess there is no need to call class.method is it ?
well im installing VS![]()
~ah machnz ubawa sehena kalekin dakke kohomda ubataane machnz man owa gena danne nam ne sorry

try this:
public static class Minuz
{
public static void Minus()
{
int minus;
minus = Program.i - Program.j;
Console.WriteLine("The Subraction Of The First and The Second Number is {0}", minus);
}
}
Still d same prob bro 
I don't know C#, otherwise I wud'v helped. Here is a site that I often use for my coding problems. it's quite popular, you can post any type of coding question
www.stackoverflow.com
TΞΞNSTAR™;6834530 said:Nah its Minuz.minus in the correct case.. :s ah yeh nah execute the file u shud call it to the main method na ! correct me if if i am wrong!

okie dokie brooh damn sorry man. it should be. cuz its a static method, my bad lol
hold on man. installing VS restart needed![]()
waitingggg!!class Program
{
public static int i, j;
public static void Main()
{
Console.Write("Please Enter The First Number :");
string temp = Console.ReadLine();
i = Int32.Parse(temp);
Console.Write("Please Enter The Second Number :");
temp = Console.ReadLine();
j = Int32.Parse(temp);
Terms.Minus();
}
}
class Terms
{
public static void Add()
{
int add;
add = Program.i + Program.j;
Console.WriteLine("The Addition Of The First and The Second Number is {0}", add);
}
public static void Minus()
{
int minus;
minus = Program.i - Program.j;
Console.WriteLine("The Subraction Of The First and The Second Number is {0}", minus);
}
}
this works ! i modified it
ts working now.. but what was the problem earlier?? :sTΞΞNSTAR™;6834843 said:YEHHts working now.. but what was the problem earlier?? :s


machan you have included a inner class Minus inside Test i think that wouldnt have been necessary or correct syntax in C# (itz possible in java though) ,
you could have seprate classes for addition and subtsractions etc if you want![]()
Thaankkuuuusoooomucchhh

Avoid static methods and classes as much as possible. It is not a good idea if you are going to re-use the same component (class/method) in different places. Think you need to check little bit about variable scope/visibility and access control kind of things. If you are studying the particular language first learn those theories rather than just fixing the code. Otherwise you'll face lot difficulties in your future work these basic concepts.![]()