+ 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(); } } }
24 Antworten
+ 13
Marano Yann
https://code.sololearn.com/cRxf5FM7G7Q0/?ref=app
Input like:
Gaurav
6
8
+ 8
Which app you run your c# program and pls tell about your
Program and which way you run your program.
+ 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}");
+ 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!!! 😉
+ 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);
+ 3
Gaurav Dixit 🇮🇳 🤩well done bro
+ 2
Try changing that Readline and Writeline l to capital L
+ 2
Oh I also didn't see that integer it just gave me the string output ,dunno why
+ 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?
+ 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();
}
}
}
+ 1
Ooh thanks that was just it 🙏
0
Please how Can i send it i can't send screenshot
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();
}
}
}
0
Thanks for your different intervation, i really want to learn particularly during this confinement period
0
Please can you check my code? I can't see my integer during the execution?
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);
0
I dont know because Im just a beginner
0
just give a rough idea what is basically happening?
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