Hello! How are you doing dear all?
I am trying to do some training in Csharp, typing a small console program to calculate vaules from seperated classes and methods, I have typed like these lines so far:
- using System;
- namespace spacesqm
- {
- public class EnterData
- {
- public int length;
- public int width;
- public int height;
- public int EnterNumbers ()
- {
- Console.WriteLine ("Welcome, Can you press any Key to proceed!");
- Console.ReadKey ();
- //Type and record the 'length' Variable
- Console.WriteLine ("Type The Length in centimeter: ");
- length = Convert.ToInt32 (Console.ReadLine());
- Console.WriteLine ("Type The width in centimeter: ");
- width = Convert.ToInt32 (Console.ReadLine());
- Console.WriteLine ("Type The height in centimeter: ");
- height = Convert.ToInt32 (Console.ReadLine());
- //Type Thank you and close the method
- Console.WriteLine ("Thank you a lot the information had been entered successfully!");
- Console.WriteLine ("Type any key to Calculate...");
- Console.ReadKey ();
- Console.Clear ();
- return (length, width, height) ;
- }
- }
- }
The problem is that, when I call the values from another class, the value return 0 eventhough...
Do you have any solution pls?
Thank you & Regards,
Ehssan Dannouf,


Rajanikant HawaldarRank #110 · 20.2K reputationPosted Feb 29, 2020, 6:16 PM EST
Ehssan Dannouf34 reputationPosted Mar 1, 2020, 5:25 AM EST
Ehssan Dannouf34 reputationPosted Mar 1, 2020, 5:35 AM EST
Rajanikant HawaldarRank #110 · 20.2K reputationPosted Mar 1, 2020, 6:00 AM EST
Ehssan Dannouf34 reputationPosted Mar 1, 2020, 6:20 AM EST
Ehssan Dannouf34 reputationPosted Mar 1, 2020, 6:57 AM EST
Ehssan Dannouf34 reputationPosted Mar 1, 2020, 7:17 AM EST