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,

Ehssan DannoufPosted Mar 1, 2020, 12:17 PM
Ehssan DannoufPosted Mar 1, 2020, 11:57 AM
Ehssan DannoufPosted Mar 1, 2020, 11:20 AM
Rajanikant HawaldarPosted Mar 1, 2020, 11:00 AM
Ehssan DannoufPosted Mar 1, 2020, 10:35 AM
Ehssan DannoufPosted Mar 1, 2020, 10:25 AM
Rajanikant HawaldarPosted Feb 29, 2020, 11:16 PM