Category: Source Code: Programing Source Code

C++ program to demonstrate Inheritance

This is a simple C++ Program to demonstrate Inheritance. Simpler methods in the classes have been changed to inline code to shorten the file considerably. In a practical programming situation, methods that are this short should be programmed inline since the actual code to return a simple value is shorter than the code required to send a message to a non-inline method.

Read More

Generating Controlled Random Numbers in C#

Generating random numbers is a fundamental requirement in various programming scenarios, from creating dynamic content to simulating unpredictable events. In C#, the System.Random class provides a versatile solution for generating random values. In this article, are going to explore the basics of random number generation in C# and write practical examples that showcase its applications.

Read More

C Program: Number Shuffling Game

This C program is a simple console-based implementation of a number-shuffling game. The game presents a grid of numbers, and the objective is to rearrange them in ascending order. The player can move the numbers by pressing the corresponding number keys, and the game tracks the number of moves taken to complete the puzzle.

Read More

Snake Game – C Imlementation

This C program simulates the game “snake” which is usually available in old mobile phones. A string of characters moves on the screen according to arrow keys pressed by user. If it touches itself or screen boundary, the program terminates. When the snake moves, in arbitrary screen positions some digit (1-9) appears. The objective of the game is to make the snake eat the said digit, so that it is added to the score. When a digit is eaten, the size of the snake increases by the number of characters equal to the value of the digit.

Read More