Author: M. Saqib

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

C Program – Tic-Tac-Toe Game – Command Line

This is a console version of Tic Tac Toe computer game written in c programming language. The game runs in text mode of command prompt and users can play the game in text mode. The game has many options to choose from, like playing with computer, friend. While playing with computer use can select either novice mode or advance mode.

Read More

Advanced C++ Inheritance Techniques for Effective Object-Oriented Programming

In Object Oriented Programming Inheritance is the process by which objects of one class acquire the properties and functionality of objects of another class. In the last tutorial on inheritance in C++ we developed a model using modes of transportation to illustrate the concept of inheritance. In this article we will use that model to illustrate some of the finer points of inheritance and what it can be used for.

Read More

Inheritance in C++

The principle of inheritance is available with several modern programming languages and is handled slightly differently with each. C++ allows you to inherit all or part of the members and methods of a class, modify some, and add new ones not available in the parent class. You have complete flexibility, and as usual, the method used with C++ has been selected to result in the most efficient code execution.

Read More

C++ Memory Management

Everyone knows that memory management is a difficult and dangerous chore in C++. This series of three articles will show you that the conventional wisdom is not true. When approached correctly, C++’s seemingly archaic memory-management scheme actually provides an opportunity to create spectacular programs – programs that would not be possible with more modern languages that handle memory automatically.

Read More

C Program to show Fibonacci Sequence

This C program prints out the first Fibonacci series of N numbers. In mathematics, the Fibonacci numbers are a sequence of numbers named after Leonardo of Pisa, known as Fibonacci. The first number of the sequence is 0, the second number is 1, and each subsequent number is equal to the sum of the previous two numbers of the sequence itself, thus creating the sequence 0, 1, 1, 2, 3, 5, 8, etc. The standard form of writing Fibonacci series is:

Read More