38 Answered Questions for the topic C#

C#

05/22/19

How to tell whether a point is to the right or left side of a line?

I have a set of points. I want to separate them into 2 distinct sets. To do this, I choose two points (*a* and *b*) and draw an imaginary line between them. Now I want to have all points that are... more
C#

05/21/19

End of month calculations?

Just wondering if any know of an elegant solution for the following. If I have 30 June 2009 and I add a month I want it to go to 31 July 2009, not the 30 July 2009. This logic is based on the... more
C#

05/12/19

C# & operator clarification?

I saw a couple of questions here about the diference between && and & operators in C#, but I am still confused how it is used, and what outcome results in different situations. For... more
C#

05/01/19

Given 3 pts, how do I calculate the normal vector?

Given three 3D points (A,B, & C) how do I calculate the normal vector? The three points define a plane and I want the vector perpendicular to this plane. Can I get sample C# code that... more
C#

04/27/19

Can you help me with C#?

Write an application that creates a two-dimensional array. Allow the user to input the size of the array (number of rows and number of columns). Fill the array with random numbers between 0 and... more
C#

04/12/19

Multi-variable switch statement in c#?

I would like use a switch statement which takes several variables and looks like this: switch (intVal1, strVal2, boolVal3) { case 1, "hello", false: break; case 2, "world", false: break; ... more
C#

04/04/19

&& operator behaves like || operator?

I am a beginner and I've been trying to run a program that prints all the numbers from 1 to N (user input) except for those that are divisible by 3 and 7 at the same time. What my code does... more
C#

03/27/19

How can I check out the picture quality in program using c#?

I want to check out whether the photograph is suitable for print or not using my application.How can I do that?I don't know much about photo quality?Is the resolution of every photograph is same or... more
C#

03/18/19

Draw arc with angles ranging from -360 to 360 degrees?

I am having some trouble trying to implement drawing an arc. Basically it's supposed to be drawn exactly like how you can draw a 3 point arc in AutoCAD. I can get the arc to draw with start and end... more
C#

03/18/19

Draw arc with angles ranging from -360 to 360 degrees?

I am having some trouble trying to implement drawing an arc. Basically it's supposed to be drawn exactly like how you can draw a 3 point arc in AutoCAD. I can get the arc to draw with start and end... more
C#

03/14/19

How to create a method to return 1 or 0 without using conditions?

I was asked a question in an interview to return 1 if provided 0 and return 0 if provided 1 without using conditions i.e if, ternary etc Just to give you and idea below code without if's: public... more
C#

03/13/19

Generate identical Hashcodes for approximately-similar numbers?

I'm creating an application in C# 3.5 that uses the AutoCAD API to read a 2D AutoCAD drawing, make changes to the drawing using defined business logic, then adjust it back in AutoCAD. Due to the... more
C#

03/21/17

what C# collections

explain C# collections
2

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.