Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
Pure VPN - Up to 27 Months
vgp
Updated:
Yesterday at 8:10 AM
එක පැකේජ් එකයි මාසෙටම Unlimited Internet. තාමත් DATA CARD දාන්න සල්ලි වියදම් කරනවද? අඩුම මිලට අපෙන්.
sayuru bandara
Updated:
Tuesday at 12:30 PM
Ad icon
ඉන්ටර්නෙට් එකෙන් හරියටම සල්ලි හොයන්න සහ Success වෙන්න කැමතිද? 🚀 (E-Money & Success Stories)
siri sumana
Updated:
May 30, 2026
Gemini AI PRO 18 months Offer
Hawaka
Updated:
May 27, 2026
Ad icon
koko account
DasunEranga
Updated:
May 27, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
ElaKiri Help
Need Help With a Simple C# Program!
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="TΞΞNSTAR™" data-source="post: 6834256" data-attributes="member: 88129"><p>Guys Another Prob <img src="/styles/default/xenforo/smilies/default/sad.gif" class="smilie" loading="lazy" alt=":(" title="Sad :(" data-shortname=":(" /></p><p></p><p>I Want to call a class into the Main method.. And im getting this error :s </p><p></p><p></p><p>[CODE]using System;</p><p></p><p></p><p>namespace AddMinusDivideMultiply</p><p>{</p><p> class Program</p><p> {</p><p> public static int i, j;</p><p></p><p> public static void Main()</p><p> {</p><p></p><p> Console.Write("Please Enter The First Number :");</p><p> string temp = Console.ReadLine();</p><p> i = Int32.Parse(temp);</p><p></p><p> Console.Write("Please Enter The Second Number :");</p><p> temp = Console.ReadLine();</p><p> j = Int32.Parse(temp);</p><p>[COLOR=Red][B]</p><p> Minuz.minus();[/B][/COLOR] // Here its generating an Error - Error 1 The name 'Minuz' does not exist in the current context </p><p></p><p> </p><p> }</p><p> }</p><p></p><p> class Terms</p><p> {</p><p> public static void Add()</p><p> {</p><p> int add;</p><p> add = Program.i + Program.j;</p><p> Console.WriteLine("The Addition Of The First and The Second Number is {0}", add);</p><p> }</p><p></p><p> class Minuz</p><p> {</p><p> public static void Minus()</p><p> {</p><p> int minus;</p><p> minus = Program.i - Program.j;</p><p> Console.WriteLine("The Subraction Of The First and The Second Number is {0}", minus);</p><p> }</p><p> }</p><p> }</p><p>}</p><p>[/CODE]</p></blockquote><p></p>
[QUOTE="TΞΞNSTAR™, post: 6834256, member: 88129"] 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); } } } } [/CODE] [/QUOTE]
Insert quotes…
Verification
Winadiyakata thappara keeyak tibeda?
Post reply
Top
Bottom