Find an Online Tutor Now

51 Answered Questions for the topic C#

C# Display a pyramid

Hi!I have found this code in the internet: for (int i = 1; i< 10; i++) { for(int j= 1; j<= i; j++) { Console.Write(i); ... more

Programming with C#

Hi, why does it become red in the following code?/* Console.Write("Write a number: ");int number = Convert.ToInt32(Console.ReadLine());if (number % 2 == 0 && (11 < number < 21 || 34... more

08/02/20

URGENT: Problems with API in C# ASP.NET Core

I am doing an ASP.NET Core Website and have to show the list of all countries with their travel advisory scores in a table. I can't display the data using a Travel Advisory API. Each country is a... more

08/02/20

URGENT! Can't show data using API with C# ASP.NET Core

I am using a Travel Advisory API but am unable to show all the data. Each country is a separate key and form different classes when I paste the JSON as classes.How can I call each country class... more

Conditional Statements In C Programmin

Question 11.Given the following code: switch(x - y) { case 0: return x; case 4: break; case 7: x = x - 1; case 9: return x*y; case 3: default: return y - x; ... more

Logical Operators in C programming

1.Question Is the following expression true or false? -1 * -2 == 14 % 4 TrueFalse2.Question 2Is the following conditional statement true or false? int x = 6; -3 < 5 || !(x % 3 == 0) TrueFalse

03/19/20

Printing Problem in C programming

1.Question For the following code: int a = -1; int b = a * 5; printf("a is %d, and b is %d. ", a, b); What is the output?2.Question int x = -1; int y = 3; x= x + Y; printf("x - y is %d. ", x -... more

03/18/20

What does g(-2, 5) evaluate to?

What does g(-2, 5) evaluate to? int g (int x, int y) { x= x + y; int z = 2 * x + y; return z; }

01/27/20

Microsoft Visual Studio - Unable to start program Win32 application - Error Message???

Hello,I cannot seem to check my html/css code in my web browser anymore. I keep getting the same error message even after I rebuild it in a new page. Do you have a tip on how to fix this?Error... more

10/18/19

TypeScript saving a file to a server

I am altering an existing API that uses TypeScript. I need to have the API save a file to an external server. Is there a way to do this without having a Save File window show up in TypeScript? ... more

09/28/19

C# Interactive GUI Form Help

Write a GUI program named EggsInteractiveGUI that allows a user to input the number of eggs produced in a month by each of five chickens. Sum the eggs, then display the total in dozens and eggs.... more
C#

08/04/19

Report Viewer limitation?

I have a ReportViewer(C#, asp.net 4.5). My query returns over 700'000 rows of data but it takes forever for the report viewer to show(it does not show, I think report viewer rendering is... more
C#

08/03/19

Finding the coordinates on the edge of a circle?

Using C#: How do I get the (x, y) coordinates on the edge of a circle for any given degree, if I have the center coordinates and the radius? There is probably SIN, TAN, COSIN and other grade ten... more

const correctness in C#?

The point of const-correctness is to be able to provide a view of an instance that can't be altered or deleted by the user. The compiler supports this by pointing out when you break constness from... more
C#

07/27/19

Check if a point is in a rotated rectangle (C#)?

I have a program in C# (Windows Forms) which draws some rectangles on a picturebox. They can be drawn at an angle too (rotated). I know each of the rectangles' start point (upper-left corner),... more

Partially Overriding a Virtual Auto-Property in a Child Class?

Time for a theoretical question I just ran across.The following code is valid and compiles: public class Parent { public virtual object TestProperty { get; set; } } public class... more
C#

07/19/19

Get file to send as attachment from byte array?

I have an ASP.NET MVC application that has to send an email to a list of recipients with an attachment detailing a specific "Project". I get the details for this from a report by making use of SQL... more
C#

07/19/19

How to get last inserted id?

I have this code: string insertSql = "INSERT INTO aspnet_GameProfiles(UserId,GameId) VALUES(@UserId, @GameId)"; using (SqlConnection myConnection = new... more
C#

07/16/19

C# class within a class (or nesting)?

Hey all I have made the following class: public class ssrsFormats { public static readonly string pdf = "PDF", mhtml = "MHTML", html4 = "HTML4.0", html3 = "HTML3.2", ... more

07/15/19

Arrays in c# programming/passing by reference

Create two static methods, one called changePrices and one called printit. When the changePrices method is called from Main you should pass the item_price array by reference, the price point and... more

What is Entity Framework in MVC?

07/13/19

Does the ``??`` operator use shortcircuiting?

Does the `??` operator in C# use shortcircuiting when evaluating? var result = myObject ?? ExpressionWithSideEffects(); When ``myObject`` is non-null, the result of... more

07/13/19

Most succinct way to determine if a variable equals a value from a 'list' of values?

If I have a variable in C# that needs to be checked to determine if it is equal to one of a set of variables, what is the best way to do this? I'm not looking for a solution that stores the set in... more

07/11/19

Can we generate .DWG using autoCAD and programmed using java or C#? If yes, which one language is best to go with?

write a program in java/c# use auto CAD lib Run the code Shall generate .dwg format files
C#

07/11/19

How to know if a line intersects a plane in C#?

I have two points (a line segment) and a rectangle. I would like to know how to calculate if the line segment intersects the rectangle.
1 3

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.