Moving car program in C++

C Programming Tutorial

Moving Car Program in C++ This program is written in C++ using graphics to create and move a car. A car is made using two rectangles and two circles which act as tyres of car. A for loop is used to move the car forward by changing the rectangle and circle coordinates and erasing the … Read more

Graphics Program in C++ for Analog Clock

C Programming Tutorial

Analog Clock is mini project  in a C ++ language. It is graphics application using graphic library <graphics.h>. This program is Compiled using Turbo C++. Here is the source code of this program in C++ using Graphics.   /*Program for analog CLock*/ #include <stdio.h> #include <conio.h> #include <math.h> #include <string.h> #include <graphics.h> #include <time.h> #include <dos.h> void minSecPos(int xrad, int midx, … Read more

C program to find armstrong number

C Programming Tutorial

What is Armstrong number? Sum of a number’s digits raised to the power total number of digits is armstrong number. Armstrong numbers example: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 153, 370, 371, 407, 1634 etc Explanation: 3 = 3^1 = 3 153 = 1^3 + 5^3 + 3^3 = 153 Non-Armstrong … Read more

Simple Calculator program in C

C Programming Tutorial

This is a simple calculator program written in C Language. It Performs addition, subtraction, multiplication or division depending the input from user. This usage switch case statement. Let see the C Program # include <stdio.h> int main() { char operator; double firstNumber,secondNumber; printf(“Enter an operator (+, -, *,): “); scanf(“%c”, &operator); printf(“Enter two operands: “); … Read more

Analog Clock Program in C

C Programming Tutorial

Here is simple C program for analog clock.  This can be used as a reference for project reference. /*Note press ctrl+pause break to stop the clock while executing in TC*/ #include<stdio.h> #include<graphics.h> #include<stdlib.h> #include<math.h> #include<dos.h> #include<time.h> #define PI 3.147 void clockLayout(); void secHand(); void hrHand(); void minHand(); int maxx,maxy; void main() { int gdriver=DETECT,gmode,error; initgraph(&gdriver,&gmode,“c:\turboc3\bgi\”); … Read more

C Program to Check Leap Year

C Programming Tutorial

   A year is a leap year if − It is evenly divisible by 100 If it is divisible by 100, then it should also be divisible by 400 Except this, all other years evenly divisible by 4 are leap years. —————————————————————— #include <stdio.h> int main() { int year; printf(“Enter a year: “); scanf(“%d”,&year); if(year%4 … Read more

C program for Snake game

C Programming Tutorial

Snake Game is mini project  in a C language. It is console application without graphic library that’s why it is more interesting. This game is perfect without any error and better user interface. It is complied in code block using c language. Here goes a source code you can copy and compiled it in code block. … Read more

C Program to find prime number

C Programming Tutorial

What is prime number? Definition of prime number A number is considered as prime number when it satisfies the below conditions.It should be whole number It should be greater than 1 It should have only 2 factors. They are, 1 and the number itself. For Example: 2, 3, 5, 7, 11, 13, 17, 19, 23, … Read more