Showing posts with label c projects. Show all posts
Showing posts with label c projects. Show all posts

Monday, September 24, 2012

Tic Tack Toi game in c

#include<graphics.h>
#include<iostream.h>
#include <conio.h>
void main()
{
start: int a[3][3]={5,6,7,8,9,10,11,12,13},i,j,k,x,y,t,cn=0,co=0;
char c;
static int nod=0,nn=0,sc[2]={0,0};
nod++;
clrscr();
int driver=DETECT,mode;

Monday, April 16, 2012

Phone bill project in c , phone bill in c


Phone Bill System Project

# include <conio.h>
# include <stdio.h>
# include <alloc.h>
# include <string.h>

struct node
{
int num;
char name[15];
struct node *next;
};

struct node *list; //global start pointer
FILE *fp; // Global file pointer

struct node *getrecord()
{
struct node *temp,e;
temp=(struct node*)malloc(sizeof(struct node));

printf("Reached till here...");
getch();

fflush(stdin);
// fscanf(fp,"%d %s
",&temp->num,temp->name);
fread(&temp,sizeof(temp),1,fp);
printf("%d %s",temp->num,temp->name);

// temp->num=e.num;
// strcpy(temp->name,e.name);
getch();
temp->next = NULL;
return temp;
}

struct node *getnode()
{
struct node *temp;
temp = (struct node*)malloc(sizeof(struct node));

printf("
Enter the person's phone number--->");
scanf("%d",&temp->num);

printf("
Enter the person's Name--->");
scanf("%s",&temp->name);

temp->next = NULL;
return temp;
}

struct node *search(int id,int *flag)
{
struct node *cur,*prev;
*flag=0;

if
(list==NULL)
return NULL;

for(prev=NULL,cur=list; (cur); prev=cur,cur=cur->next)
if(cur->num == id)
{
*flag = 1;
break;
}

Monday, April 2, 2012

Travel Agency , Travel management Project In C++




Hey friends this is a program for travel agency management written in c++ ,, If you are looking for this kind of code surely it will help you. hope you will enjoy it.
download source code:-

http://www.adrive.com/public/z3mNmC/travel.cpp

Saturday, February 11, 2012

Sudoku Game In C



 #include<stdio.h>
#include<stdlib.h>
#include<conio.h>
#include<time.h>
int a[9][9],b[9][9],r[60][2];
int row, col, icount, mode;
char solh;
void main()
{


Tuesday, November 1, 2011

Program to calculate the Typing Speed

/*Program is written in c u just save it with extension .cpp . Because this program uses class and friend function so it's a cpp programm */

#include  <stdio.h>
#include  <dos.h>
#include  <conio.h>
#define   ESC 0x1b
#define   BSPACE 0x08

const unsigned long far * const dosTime = (const unsigned long far * const)MK_FP( 0x40, 0x6C );

class Timer

Student Management System / Information System


/* Student Management System */

#include <stdio.h>
#include <alloc.h>
#include <stdlib.h>
#include <conio.h>
#include <ctype.h>
#include <string.h>

/* function prototypes */

void create( char *, int, int, char * );
void printnode( struct node * );
void display( struct node * );
struct node * search( struct node *, int );

Converting Roman letter to Decimal value

//Converting Roman letter to number

#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<stdlib.h>
void main()
{
int *a,l,i,j,k;
char *s;
clrscr();
printf("Enter The Roman Number use upper case letters");

Convert decimail to roman

//Convert decimail nos to roman equivalent upto 10,000

/*
                     Roman      Decimal
                     1                  i
                     5                  v
                     10                x
                     50                l
                     100              c
                     500             d
                     1000           m                 */


#include<stdio.h>
#include<conio.h>
void thousand(int i) //Function for generating roman equivalent of 1000's
{
                int x;
                for(x=1;x<=i;x++)
                printf("m");
}
void hundred(int x) //Function for generating roman eq of 100's

Telephone Directory

/* PROGRAM TO IMPLEMENT A PHONE RECORD DATABASE USING LINKED LIST
AND FILE HANDLING USING FORMATTED I/O FUNCTIONS fscanf() and
fprintf()
*/

# include <conio.h>
# include <stdio.h>
# include <alloc.h>
# include <string.h>

struct node
{
int num;
char name[15];
struct node *next;
};

Guessing Game in C

//Guessing Game in C

#include <stdio.h>

int main()

{
         int mybday = 20; //declare variable to be guessed
         int guess;    //declare variable to store guessed date
         int max = 31;     //declare variable to test for invalid input
         int min = 1;   //declare variable to test for invalid input
            clrscr();
         printf("Try to guess the day of my Birthday: "); //display the intro and directions
          scanf("%d",&guess);   //`get the users guess and store it in the variable guess

         if (guess == mybday)
                 {
                 printf("You Win!!");    //print you win if guess is correct
         }
         else if (guess < min)
                 {
                 printf("Thats NOT A DATE!!"); //print `Error for invalid input
         }
         else if (guess > max)
     {
                 printf("There isn't %d days in a month!",guess);  //print Error for invalid input
         }
         else if (guess > mybday)
         {
                 printf("Too High!");  //print too high if guess is above answer
         }
         else if (guess < mybday)
                 {
                 printf("Too Low!"); //print too low if guess is below answer
         }
                 else
         {
                 printf("Try again!!");    //Print try again if guess if all else is not true (not possible)
         }

         return 0;
}

Analog Clock Program

//Analog Clock Program
//code will work on windows xp / dos box /not in win7

#include<graphics.h>
#include<conio.h>
#include<math.h>
#include<dos.h>
void main()
{
int gd=DETECT,gm;
int x=320,y=240,r=200,i,h,m,s,thetamin,thetasec;
struct  time t;
char n[12][3]={"3","2","1","12","11","10","9","8","7","6","5","4"};
initgraph(&gd,&gm,"f:\arun\tc");

Program for Decimal to Roman Number conversion

//Program for Decimal to Roman Number conversion

#include<stdio.h>

main()
{
int a,b,c,d,e;
clrscr();
printf("Input a  number (between 1-3000):");
scanf("%d",&e);
while (e==0||e>3000)

program for mobile billing management

# include <conio.h>
# include <stdio.h>
# include <alloc.h>
# include <string.h>

struct node
{
int num;
char name[15];
struct node *next;
};