Monday, September 24, 2012

Bresenham's line drawing code in c

# include <stdio.h>
# include <conio.h>
# include <graphics.h>

void main()
{
int dx,dy,x,y,p,x1,y1,x2,y2;
int gd,gm;

clrscr();

printf("\n\n\tEnter the co-ordinates of first point : ");
scanf("%d %d",&x1,&y1);
printf("\n\n\tEnter the co-ordinates of second point : ");
scanf("%d %d",&x2,&y2);

Bresenham Circle drawing program in c

# include<stdio.h>
# include<conio.h>
# include<graphics.h>
# include<math.h>

void main()
{
int gd=DETECT,gm;
int r,x,y,p,xc=320,yc=240;
initgraph(&gd,&gm,"C:\\TC\\BGI");
cleardevice();
printf("Enter the radius ");
scanf("%d",&r);
x=0;

Friday, April 20, 2012

AVL tree, insertion in avl tree


This is a program of insertion in avl tree and checking the weight of nodes then performing further operations hope it will help you.






























/*Program for insertion in AVL tree*/
#include<stdio.h>
#include<malloc.h>

typedef enum { FALSE ,TRUE } bool;
struct node
{
      int info;
      int balance;
      struct  node *lchild;
      struct  node *rchild;
};

struct node *insert (int , struct node *, int *);
struct node* search(struct node *,int);

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;
}

Thursday, April 12, 2012

4G launch in INDIA

Know about 4G


Bharti Airtel on Tuesday become the first company in India to offer high-speed Internet services using fourth-generation (4G) telecommunications technology.

The company said high-speed wireless broadband "has the potential to transform India" and to provide a platform for "building the country's digital economy."

What's new in 4G technology?

Visual Studio 2011 beta

Microsoft launches Visual studio 2011 beta. It's an awesome release after visual studio 2010. Much advance than its previous versions, start with an awesome installation screen minimal user interaction required for installing it takes about 10GB of disk space. And take about more than 30 min. to install in my system dual core it take 45 min. . After installing when i launched it takes 35 sec to start in full mode.
Try it

http://www.microsoft.com/visualstudio/11/en-us/downloads#vs