+ 2

Please tell me why my program can't execute?! I'm using C# app

Program error -------- Post Edit by David Carroll: Adding code here as posted in the thread by Marano Yann -------- using System; using System.IO; using System.Linq; using System.Collections.Generic; namespace Beginner { public class King_Mar0 { static void Main(string[] arg) { int x=10; int y=18; int s=x+y; Console.Writeline("Hello King Marano"); Console.Writeline("solution of" ,x, "+" ,y, "is" ,s); Console.Readline(); } } }

27th Apr 2020, 8:53 PM
Marano Yann
Marano Yann - avatar
24 Antworten
10th May 2020, 5:38 PM
Gaurav Dixit🇮🇳
Gaurav Dixit🇮🇳 - avatar
+ 8
Which app you run your c# program and pls tell about your Program and which way you run your program.
29th Apr 2020, 2:26 PM
Gaurav Dixit🇮🇳
Gaurav Dixit🇮🇳 - avatar
+ 5
Sam I agree... string interpolation would make sense. However, your first example uses a composite format string and your second example used string concatenation. String interpolation requires the use of the $ placed outside the left quotation mark of the string. String interpolation would be: Console.WriteLine(
quot;solution of {x} + {y} , is {s}");
28th Apr 2020, 8:27 AM
David Carroll
David Carroll - avatar
+ 4
Provide details while asking question? How will we know why your program is not executing without seeing the error message? WE ARE NOT OMNIPRESENT!!! 😉
27th Apr 2020, 9:07 PM
RKK
RKK - avatar
+ 4
Marano Yann you say you are a beginner but you really went into writing stuff before learning the basics? I don't even know about C# but I know how to use Google ,here it is Console.WriteLine("solution of{0} +{1} is {2}",x,y,s);
27th Apr 2020, 10:01 PM
Abhay
Abhay - avatar
+ 3
Gaurav Dixit 🇮🇳 🤩well done bro
12th May 2020, 3:39 AM
NARESH KUMAR
NARESH KUMAR - avatar
+ 2
Try changing that Readline and Writeline l to capital L
27th Apr 2020, 9:40 PM
Abhay
Abhay - avatar
+ 2
Oh I also didn't see that integer it just gave me the string output ,dunno why
27th Apr 2020, 9:55 PM
Abhay
Abhay - avatar
+ 1
Marano Yann you can copy the code and paste in code playground in sololearn app and then save the code and link it in here or maybe copy the code and just paste here?
27th Apr 2020, 9:32 PM
Abhay
Abhay - avatar
+ 1
Well this works here using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SoloLearn { class Program { static void Main(string[] arg) { int x=10; int y=18; int s=x+y; Console.WriteLine("Hello King Marano"); Console.WriteLine("solution of" ,x, "+" ,y, "is" ,s); Console.ReadLine(); } } }
27th Apr 2020, 9:39 PM
Abhay
Abhay - avatar
+ 1
Ooh thanks that was just it 🙏
27th Apr 2020, 9:45 PM
Marano Yann
Marano Yann - avatar
0
Please how Can i send it i can't send screenshot
27th Apr 2020, 9:29 PM
Marano Yann
Marano Yann - avatar
0
using System; using System.IO; using System.Linq; using System.Collections.Generic; namespace Beginner { public class King_Mar0 { static void Main(string[] arg) { int x=10; int y=18; int s=x+y; Console.Writeline("Hello King Marano"); Console.Writeline("solution of" ,x, "+" ,y, "is" ,s); Console.Readline(); } } }
27th Apr 2020, 9:33 PM
Marano Yann
Marano Yann - avatar
27th Apr 2020, 9:35 PM
Marano Yann
Marano Yann - avatar
0
Thanks for your different intervation, i really want to learn particularly during this confinement period
27th Apr 2020, 9:37 PM
Marano Yann
Marano Yann - avatar
0
Please can you check my code? I can't see my integer during the execution?
27th Apr 2020, 9:48 PM
Marano Yann
Marano Yann - avatar
0
String interpolation would be a great idea here Console.WriteLine("solution of {0} + {1} , is {2}", x, y ,s ) Or Console.WriteLine("solution of" + x + "+" + y+" is " + s);
28th Apr 2020, 3:47 AM
Sam
Sam - avatar
0
I dont know because Im just a beginner
28th Apr 2020, 10:01 PM
Matuidi Alan
0
just give a rough idea what is basically happening?
29th Apr 2020, 9:48 AM
Aashir Azeem
Aashir Azeem - avatar
0
namespace Example { public class My_add_program { static void Main(string[] args) { double firstNumber, secondNumber; string userName; Console.WriteLine("Enter your name:"); userName = Console.ReadLine(); Console.WriteLine(
quot;Welcome {userName}!"); Console.WriteLine("Now give me a number:"); firstNumber = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("Now give me another number:"); secondNumber = Convert.ToDouble(Console.ReadLine()); Console.WriteLine(
quot;The sum of {firstNumber} and {secondNumber} is " +
quot;{firstNumber + secondNumber}."); } } } //That IS my program, let me send the execution
10th May 2020, 5:04 PM
Marano Yann
Marano Yann - avatar