Posts

Showing posts from April, 2012

Program in C to insert a node at the last position in a given doubly linked list.

#include<stdio.h> #include<conio.h> #include<alloc.h> #define null 0 void main() { struct dnode { struct dnode *prev; int data; struct dnode *next; } *temp,*start,*end,*n; int i; char c; clrscr(); start=end=null; for(i=0;i<=1;i++) { if(start==null) { printf("enter data for the node:"); scanf("%d",&temp->data); temp->next=null; temp->prev=null; start=temp; end=temp; } else { while(1) { printf("are you want to add another node(y/Y):"); fflush(stdin); scanf("%c",&c); if(c=='y'||c=='Y') { n=(struct dnode*)malloc(sizeof(struct dnode)); printf("enter data for the node:"); scanf("%d",&n->data); n->next=null; ...

Program in C to insert a node at first position in a given doubly linked list.

#include<stdio.h> #include<conio.h> #include<alloc.h> #define null 0 void main() { struct dnode { struct dnode *prev; int data; struct dnode *next; } *temp,*start,*end,*n; int i; char c; clrscr(); start=end=null; for(i=0;i<=1;i++) { if(start==null) { printf("enter data for the node:"); scanf("%d",&temp->data); temp->next=null; temp->prev=null; start=temp; end=temp; } else { while(1) { printf("are you want to add another node(y/Y):"); fflush(stdin); scanf("%c",&c); if(c=='y'||c=='Y') { n=(struct dnode*)malloc(sizeof(struct dnode)); printf("enter data for the node:"); scanf("%d",&n->data); n->next=null; ...

Program in C to subtract two polynomials.

#include<stdio.h> #include<conio.h> #include<stdlib.h> #define NULL 0 void main() { struct poly { int coff; int expo; struct poly *link; }*temp1,*start1,*temp2,*start2,*start3,*temp3; int n,i,z=1,num; char c; clrscr(); start1=NULL; printf("\tPOLYNOMIAL CREATION IN LINK LIST AND SUBTRACTION\n\n"); while(1) { if(start1==NULL) { temp1=(struct poly*)malloc(sizeof(struct poly)); printf("Enter Coefficient and Exponent for Node %d\n",z); scanf("%d %d",&temp1->coff,&temp1->expo); start1=temp1; temp1->link=NULL; } else { temp1->link=(struct poly*)malloc(sizeof(struct poly)); temp1=temp1->link; printf("Enter Coefficient and exponent for Node %d\n",z); scanf("%d %d",&temp1->coff,&temp1->expo); } z++; printf("Do you want to create another node\n"); fflush(stdin); scanf("%c",&c); if(c!='y') { temp1->link=NULL; break; } } ...

Program in C to add two polynomials.

#include<stdio.h> #include<conio.h> #include<stdlib.h> #define NULL 0 void main() { struct poly { int coff; int expo; struct poly *link; }*temp1,*start1,*temp2,*start2,*start3,*temp3; int n,i,z=1,num; char c; clrscr(); start1=NULL; printf("\tPOLYNOMIAL CREATION IN LINK LIST AND ADDITION\n\n"); while(1) { if(start1==NULL) { temp1=(struct poly*)malloc(sizeof(struct poly)); printf("Enter Coefficient and Exponent for Node %d\n",z); scanf("%d %d",&temp1->coff,&temp1->expo); start1=temp1; temp1->link=NULL; } else { temp1->link=(struct poly*)malloc(sizeof(struct poly)); temp1=temp1->link; printf("Enter Coefficient and exponent for Node %d\n",z); scanf("%d %d",&temp1->coff,&temp1->expo); } z++; printf("Do you want to create another node\n...

program in C to store any polynomial using linked list.

#include<stdio.h> #include<conio.h> #include<stdlib.h> #define NULL 0 void main()  {   struct poly    {     int coff;     int expo;     struct poly *link;    }*temp,*start,*n1,*prev;   int n,i,z=1,num;   char c;   clrscr();   start=NULL;   n1=NULL;   printf("\tPOLYNOMIAL CREATION IN LINK LIST AND TRAVERSAL\n\n");   while(1)    {     if(start==NULL)      {                 temp=(struct poly*)malloc(sizeof(struct poly));                 printf("Enter Coefficient and exponent for Node %d\n",z);                 scanf("%d %d",&temp->coff,&...

idea free caller tune for one month..

dial 54444 from ur idea mobile to get 1 month free caller tune................ njoy..............................

Get all latest updates from google for free

 Now u can get all the information's to get just dial 180041999999(toll free) and say your needs then you will receive an sms relevant to your needs. Eg: if you want meaning for a particular word just call and say the word the relevant meaning will be sent through sms

how to get puk number of airtel

Sim locked? need to unlock it? just type your mobile number and sent to 785 immediately your will receive your PUK code and PIN code directly into your inbox., Enjoy.,!!

AIRTEL FREE MISS CALL ALERTS

Friends here is the new trick for airtel miss call alert... Just Type OFFER and send it to 54321 You will receive a message from Airtel Thank you for subscribing to MCA service. Your activation request is under process You will receive a confirmation SMS shortly. After some time you will get a activation message .

change ur windows XP password using command

Below are the steps how to change the XP password using command -Start-> Run -Open Cmd -Type "net user " -ENTER -Ask for New Password -Give Password Which you Want -Twice ENTER  Thats it Your password gets changed Try and post your comments here........................

C Program for Circular Queue implementation through Array

//Program for Circular Queue implementation through Array #include <stdio.h> #include<conio.h> #define MAXSIZE 5 int cq[MAXSIZE]={0}; int front,rear; void main() { void add(int); void del(); void display(); int ch,i,num; front = -1; rear = -1; clrscr(); printf("\nProgram for Circular Queue demonstration through array"); while(1) { printf("\n\nMAIN MENU\n1.INSERTION\n2.DELETION\n3.DISPLAY\n4.EXIT"); printf("\n\nENTER YOUR CHOICE : "); scanf("%d",&ch); switch(ch) { case 1: printf("\n\nENTER THE QUEUE ELEMENT : "); scanf("%d",&num); add(num); break; case 2: del(); break; case 3:    display();     break; case 4:     exit(0); default: printf("\n\nInvalid Choice . "); } } } void add(int item) { if(front ==(rear+1)%MAXSIZE) { printf("\n\nCIRCULAR QUEUE IS OVERFLOW"); } else { ...

C Program to implement NEWTON'S BACKWARD METHOD OF INTEROLATION

/*   Program to implement NEWTON'S BACKWARD METHOD OF INTEROLATION.       ---------------------------------------- */ #include<stdio.h> #include<conio.h> #include<math.h> #include<process.h> #include<conio.h> void main() { int n;                          // no. of terms. int i,j,k;                      // Loop variables float mx[10];                   // 'X' array limit 9 float my[10];                   // 'Y' array limit 9 float x;                        // User Query for what value of X float x0=0;                     // float y0;                   ...

C Program to implement NEWTON'S FORWARD METHOD OF INTEROLATION

/*   Program to implement NEWTON'S FORWARD METHOD OF INTEROLATION.       -------------------------------------- */ #include<stdio.h> #include<conio.h> #include<math.h> #include<process.h> #include<conio.h> void main() { int n;                          // no. of terms. int i,j;                        // Loop variables float ax[10];                   // 'X' array limit 9 float ay[10];                   // 'Y' array limit 9 float x;                        // User Query for what value of X float y=0;                      // Calculated value for coressponding X. float h;       ...

C Program to Implement REGULAR FALSI (FALSE POSITION) METHOD

/*   Program to Implement REGULAR FALSI (FALSE POSITION) METHOD.   EQN -> 3*x + sin(x) - exp(x) = 0. */ #include<stdio.h> #include<conio.h> #include<math.h> #include<string.h> #include<process.h> // Formulae Declaration #define EPS 0.00005 #define f(x)  3*x + sin(x) - exp(x) int n; void FAL_POS(); void main() { clrscr(); printf("\n Solution by ITERATION METHOD "); printf("\n\n Equation is -> x*x*x - 2*x + 1 = 0\n"); printf("\n Enter the no. of iterations "); scanf("%d",&n); FAL_POS(); getch(); } void FAL_POS()  {  long float x1,x2,x0;  float f1,f2,f0;  int itr=n,i;  for(x1=0.0;;)     {     f1=f(x1);     if(f1>0)       break;     else       x1=x1+0.1;     }  x0=x1-0.1;  f0=f(x0);  printf("\n\t\t----------------------------------------------------");  printf("\n ...

C Program to Implement NEWTON RAPHSON METHOD

/*   Program to Implement NEWTON RAPHSON METHOD to solve eqn.   EQN -> 3*x - cos(x) - 1 = 0. */ #include<stdio.h> #include<conio.h> #include<math.h> #include<string.h> #include<process.h> // Formulae Declaration #define f(x)   3*x - cos(x) - 1 #define df(x)  3+sin(x) int n; void NEW_RAP(); void main() { clrscr(); printf("\n Solution by NEWTON RAPHSON METHOD "); printf("\n\n Equation is -> 3*x - cos(x) - 1 = 0\n"); printf("\n Enter the no. of iterations "); scanf("%d",&n); NEW_RAP(); getch(); } void NEW_RAP()  {  float x1,x0;  float f1,f0;  float df0;  int i=1,itr;  float EPS,error;  /* finding an approximate Root of a given equation, having +ve value*/  for(x1=0.0;;x1+=0.01)     {     f1=f(x1);     if(f1>0)       break;     }  itr=n;  x0=x1-0.01;  f0=f(x0);  print...

Program to implement LANGRANGE'S INTERPOLATION FORMULA in C

/*   Program to implement LANGRANGE'S INTERPOLATION FORMULA in C.       ---------------------------------------------- */ #include<stdio.h> #include<conio.h> #include<math.h> #include<process.h> #include<conio.h> void main() { int n;                          // no. of terms. int i,j;                        // Loop variables float ax[100];                   // 'X' array limit 9 float ay[100];                   // 'Y' array limit 9 float x=0;                        // User Query for what value of X float y=0;                      // Calculated value for coressponding X. flo...

C Program to Implement ITERATION METHOD

/*   Program to Implement ITERATION METHOD.   EQN -> x*x*x - 2*x + 1 = 0. */ #include<stdio.h> #include<conio.h> #include<math.h> #define EPS 0.00005 #define F(x) (x*x*x + 1)/2 #define f(x)  x*x*x - 2*x + 1 int n; void iter(); void main() { clrscr(); printf("\n Solution by ITERATION METHOD "); printf("\n\n Equation is -> x*x*x - 2*x + 1 = 0\n"); printf("\n Enter the no. of iterations "); scanf("%d",&n); iter(); getch(); } void iter()  {  int i=0;  float x1,x2,x0;  float f1,f2,f0,error;  for(x1=1; ;x1++)     {     f1=f(x1);     if(f1>0)       break;     }  for(x0=x1-1; ;x0--)     {     f0=f(x0);     if(f0<0)       break;     }  x2=(x0+x1)/2;  printf("\n\n\t\t The 1 approximatrion to the root is : %f",x2);  for(;i<n-1;i++)    ...

C Program to implement GAUSS' FORWARD INTERPOLATION FORMULA

/*   Program to implement GAUSS' FORWARD INTERPOLATION FORMULA.       --------------------------------- */ #include<stdio.h> #include<conio.h> #include<math.h> #include<process.h> #include<conio.h> void main() { int n;                          // no. of terms. int i,j;                        // Loop variables float ax[10];                   // 'X' array limit 9 float ay[10];                   // 'Y' array limit 9 float x;                        // User Query for what value of X float nr,dr; float y=0;                      // Calculated value for coressponding X. float h;     ...

c Program to implement GAUSS' BACKWARD INTERPOLATION FORMULA

/*   Program to implement GAUSS' BACKWARD INTERPOLATION FORMULA */ #include<stdio.h> #include<conio.h> #include<math.h> #include<process.h> #include<conio.h> void main() { int n;                          // no. of terms. int i,j;                        // Loop variables float ax[10];                   // 'X' array limit 9 float ay[10];                   // 'Y' array limit 9 float x;                        // User Query for what value of X float y=0;                      // Calculated value for coressponding X. float h;                        // Calc....

c Program to Implement BISECTION METHOD

/*   Program to Implement BISECTION METHOD.   EQN -> x*log10(x) - 1.2 */ #include<stdio.h> #include<conio.h> #include<math.h> #define F(x)  (x)*log10(x)-1.2 int n; float root=1; void bisect(); void main() { clrscr(); printf("\n Solution by BISECTION METHOD "); printf("\n Equation is -> x*log(x) - 1.2 = 0\n"); printf("\n Enter the no. of iterations "); scanf("%d",&n); bisect(); getch(); } void bisect()  {  int count;  float x1,x2,x0;  float f1,f2,f0;  // Finding x2  for(x2=1; ;x2++)     {     f2=F(x2);     if(f2>0)       {       break;       }     }  printf("\n x2 = %d ",x2);  // Finding x1  for(x1=x2-1; ;x1--)     {     f1=F(x1);     if(f1<0)       {       break;       }     } ...