fun program on M Kumaran
/tags/fun-program/
Recent content in fun program on M KumaranHugo -- gohugo.ioen-usSun, 05 Apr 2020 00:00:00 +0000Solve Algebra Linear Equations using Backtracking
/2020/SolveAlgebraLinearEquationsUsingBacktracking/
Sun, 05 Apr 2020 00:00:00 +0000/2020/SolveAlgebraLinearEquationsUsingBacktracking/I received a picture puzzle in WhatsApp. I will explain here how I solved that using programming. I used Backtracking concept.
Received picture puzzle below puzzle is simple algebra concept. If you have paper and pencile then it can be solved easily. But I just wanted to use some programming concept.
Algebra notation of the puzzle just fill the empty circle with some letters (a,b,c,d,e)
Left to right
a - b = 5
c + 1 = d
12 - e = 10 Top to bottomint x=5; x += x++ + ++x; (C#)
/first/04-csharpquestion/
Fri, 04 Jan 2019 00:00:00 +0000/first/04-csharpquestion/I had this question as my WhatsApp status and got interesting answers from friends. I will explain the answer here.
increment and decrement operators are done differently in C# and C One thing that you have to remember is, the way C# does it is different than how C does it. Many people reason as though C# and C are the same language; they are not.
here is the great explanation about c# pre and post increment operators.Backtracking – 1000 locks and 1000 students problem
/first/01-backtracking/
Tue, 01 Jan 2019 00:00:00 +0000/first/01-backtracking/A high school has a strange principal. On the first day, he has his students perform an odd opening day ceremony:
I’m sure I’ll write a lot more interesting things in the future.
There are one thousand lockers and one thousand students in the school. The principal asks the first student to go to every locker and open it. Then he has the second student go to every second locker and close it.