Friday 31 January 2014

How to drow line using pixel in c code
================================================================
#include<graphics.h>
#include<conio.h>

main()
{
   int gd = DETECT, gm,x,y=50;

   initgraph(&gd, &gm, "C:\\TC\\BGI");
   for(x=50;x<=100;x++)
   {
   putpixel(x, y,WHITE);

   }
   getch();
   closegraph();
   return 0;
}

how to drow a pixel on Screen by c code

how to drow a pixel on Screen by c code
============================================================
#include<graphics.h>
#include<conio.h>

main()
{
   int gd = DETECT, gm,x=50,y=50;

   initgraph(&gd, &gm, "C:\\TC\\BGI");
  
   putpixel(x, y,WHITE);

   getch();
   closegraph();
   return 0;
}

Tuesday 14 January 2014

Monday 13 January 2014

HOW TO DOWNLOAD VIDEO FROM YOUTUBE WITHOUT ANY SOFTWARE

Tricks 1:
Go to the following link

http://en.savefrom.net

paste your youtube video link

and choose format and click download
-------------------------------------------------------------------------------------

Tricks 2:

1) Go to www.youtube.com. Open the page of the video you want to download.

2) Add "ss" between the www. and the youtube.com section of the URL and hit enter. 

Example:

Original YouTube URL:  http://www.youtube.com/

Modified YouTube URL: http://www.ssyoutube.com/

3) This will redrect your browser to another site SaveFrom.net:

4) Choose the format of the video. Click on the link of the format . 
  
5) And your download will start in your downloader.

Thursday 9 January 2014

HOW TO PERFORM BELOW PETTERN IN C

                1
               22
             333
           4444
         55555
       666666
     7777777
   88888888
 999999999
---------------------------------------------------------------------------------------------------------
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
clrscr();
for(a=1;a<=9;a++)
{
  for(b=1;b<=a;b++)
  {
  printf("%d",a);
  }
  printf("\n");
}
getch();
}

HOW TO PERFORM STACK OPERATION IN C

#include<stdio.h>
void main()
{
 int ch,i,top=0,n=5,j,s[5];

 cho:
 clrscr();
 printf("\n\n\n\n\t\t----------------stack--------------- \n");
 printf("\t\tPress 1 for Adding      value.\n\n");
 printf("\t\tpress 2 for Delete the  value.\n\n");
 printf("\t\tPress 3 for Display the value.\n\n");
 printf("\t\tPress 4 for Find  the   value.\n\n");
 printf("\t\tPress 5 for Change the  value.\n\n");
 printf("\t\tPress 6 for exit .\n\n");
 scanf("%d",&ch);


 switch(ch)
 {
   case 1:
     printf("\t\tYour choice is 1 for Entering the value.\n\n");

     if(top>=5)
     {
      printf("Stack is over flow.\n");
     }

     else if(top<=n)
     {
     top=top+1;
     printf("enter your value.");
     scanf("%d",&s[top]);
     }
    getch();

   goto cho;
   case 2:

     printf("\t\tYour choice is 2 for Delete the value.\n\n");
     if(top==0)
     {
     printf("\t\tstack have no element.\n\n");
     }
     else
      top=top-1;



   goto cho;
   case 3:
     printf("\t\tYour choice is 3 for Display element in stack.\n \n");
     if(top==0)
     {
      printf("Stack have no element.");
     }
     else
     {
    for(i=1;i<=top;i++)
    {
        printf("Element %d",s[i]);
        printf("\n");
    }
     }
     getch();
   goto cho;
   case 4:
     printf("\t\tYour choice is 4 for Find the element.\n\n");
     if(top==0)
     {
     printf("Stack have no element");
     }
     else
     {
      printf("Enter number of Element position.");
      scanf("%d",&j);


      printf("%d",s[j]);
      j=0;

     }
   break;
   case 5:
     printf("\t\tYour choice is 5 for Change element value.\n\n");




    break;

    case 6:
     printf("\t\tYour choise is 6 to exit programm \n\n");

     break;



   default:
     printf("\t\tYour choice is invalid.\n\n");
     printf("press any key to go back main menu.\n\n");
     getch();

     goto cho;



  }






 getch();
}

HOW TO PERFORM SORTING IN LINKED LIST IN C

#include<stdio.h>
struct node
{
 int info;
 struct node *next;

};
typedef struct node *newnode;
newnode first,temp1,newn,pred,temp,avail,save;
void main()
{
 int i,n,t,q,w;
 clrscr();

 //textcolor(3);
 first=NULL;
 avail=(newnode)malloc(sizeof(struct node));
 avail->next=NULL;
 printf("\n\n\t\tenter Value");
 scanf("%d",&n);
 temp=avail;
 for(i=1;i<n;i++)
 {

 temp->next=(newnode)malloc(sizeof(struct node));
 temp=temp->next;
 temp->next=NULL;

 }
m:
clrscr();
textcolor(10);
printf("\n\n\t\tCREATED BY DIXIT PANCHAL");
printf("\n\t\t ");
printf("\n\t\t                                     ");
printf("\n\t\t PRESS 1 For insert Node             ");
printf("\n\t\t PRESS 2 For Display                 ");
printf("\n\t\t PRESS 3 For Sorted Linked list     ");
printf("\n\t\t PRESS 0 For Exit                    ");
printf("\n\t\t                                     ");
printf("\n\t\t ");
scanf("%d",&w);


switch(w)
{
   case 1:
    printf("\n\n\t\t<<YOU HAVE PRESSES 1 FOR INSERT NODE.>>");
    //getch();
    if(avail==NULL)
    printf("\n\t\t<<<Node is not available>>>");
    else

    {
     newn=avail;
     avail=avail->next;
     printf("\n\t\t<<<<Enter value>>>");
     scanf("%d",&q);
     newn->info=q;
     if(first==NULL)
     {
      newn->next=NULL;
      first=newn;

     }
     else
    {
     newn->next=first;
     first=newn;
     }

     }


     getch();

     goto m;

case 2:

      printf("\n\n\t\t<<YOU HAVE PRESSES 2 FOR DISPLAY.>>");
    //getch();
      if(first==NULL)
      {
      printf("\n\n\t\t<<NO node in LINKED LIST >>");
      }
      else
      {
      temp=first;
      while(temp !=NULL)
      {
       printf("\n\t\t %d   %u %u ",temp->info,temp->next,temp);
       temp=temp->next;

      }
      /*if(first1!=NULL)
      {
       printf("\n\n\t\t ");
       printf("\n\t\t Reverse Linked list is Following  ");
       printf("\n\t\t \n\n");
       temp=first1;
      while(temp !=NULL)
      {
       printf("\n\t\t %d   %u %u ",temp->info,temp->next,temp);
       temp=temp->next;

      }

      }
    */
      }
      getch();
      goto m;

case 3:
      printf("\n\n\t\t<<YOU HAVE PRESSES 3 FOR SORTING OF LINKED LIST .>>");
      for(temp=first;temp->next!=NULL;temp=temp->next)
      {
       for(temp1=temp->next;temp!=NULL;temp1=temp1->next)
       {
      if(temp->info>=temp1->info)
      {
       t=temp->info;
       temp->info=temp1->info;
       temp1->info=t;
      }

    }

      }
      printf("\n\n\t\tSorting Operation Is Completly Successfull::");
      printf("\n\n\t\tPress any key to go Main Menu");
      getch();
      goto m;
case 0:
      printf("\n\n\t\t ");
      printf("\n\t\t   Do you want to exit?   ");
      printf("\n\t\t   Press any key to Exit  ");
      printf("\n\t\t ");
      getch();
      exit(0);
default:
      printf("\n\t\t    You Choise is Invalid\n");
      printf("\t\t  ");
      printf("\n\t\tPress any key to go Main Menu");
      getch();
      goto m;
}







getch();

}

HOW TO PERFORM SEQUENCIAL SEARCH IN C

#include<stdio.h>
#include<conio.h>
void main()
{
  int i,n=10,k[10],x;
  clrscr();
  for(i=1;i<=n;i++)
    {

     printf("\n\tEnter value:-");
     scanf("%d",&k[i]);
    }
   printf("\n\n\tEnter No you want to search:-");
   scanf("%d",&x);
   i=1;
   while(k[i]!=x)
   {
    i=i+1;
    if(i==n+1)
    {
     printf("\n\n\t\tsuccessful search");
     getch();
     return;
    }
   }
     printf("\n\n\t\tunsuccessful search");
   getch();
}

HOW TO CREATE NODE IN C FOR LINKED LIST

#include<stdio.h>
struct node
{
 int info;
 struct node *next;

};
typedef struct node *newnode;
newnode first,newn,pred,temp,avail,save;
void main()
{
 int i,n,w,q,y,x;
 clrscr();
 textcolor(11);
 first=NULL;
 avail=(newnode)malloc(sizeof(struct node));
 avail->next=NULL;
 printf("\n\n\t\tENTER VALUE OF NODE WHICH YOU WANT TO CREATE NODE SPACE>>");
 scanf("%d",&n);
 temp=avail;
 for(i=1;i<n;i++)
 {

 temp->next=(newnode)malloc(sizeof(struct node));
 temp=temp->next;
 temp->next=NULL;

 }
getch();
}

HOW TO PERFORM LINKLIST PROGRAM IN C

#include<stdio.h>
struct node
{
 int info;
 struct node *next;

};
typedef struct node *newnode;
newnode first,newn,pred,temp,avail,save;
void main()
{
 int i,n,w,q,y,x;
 clrscr();
 textcolor(11);
 first=NULL;
 avail=(newnode)malloc(sizeof(struct node));
 avail->next=NULL;
 printf("\n\n\t\tENTER VALUE OF NODE WHICH YOU WANT TO CREATE NODE SPACE>>");
 scanf("%d",&n);
 temp=avail;
 for(i=1;i<n;i++)
 {

 temp->next=(newnode)malloc(sizeof(struct node));
 temp=temp->next;
 temp->next=NULL;

 }
m:
clrscr();
textcolor(10);
printf("\n\n\t\tCREATED BY DIXIT PANCHAL");
printf("\n\t\t ");
printf("\n\t\t                                     ");
printf("\n\t\t PRESS 1 For insert at First         ");
printf("\n\t\t PRESS 2 For insert at Last          ");
printf("\n\t\t PRESS 3 For insert as order         ");
printf("\n\t\t PRESS 4 For Display                 ");
printf("\n\t\t PRESS 5 For Delete First Element    ");
printf("\n\t\t PRESS 6 For Delete Last Element     ");
printf("\n\t\t PRESS 7 For Delete Order Element    ");
printf("\n\t\t PRESS 0 For Exit                    ");
printf("\n\t\t                                     ");
printf("\n\t\t ");
scanf("%d",&w);


switch(w)
{
   case 1:
    printf("\n\n\t\t<<YOU HAVE PRESSES 1 FOR INSERT NODE AT FIRST.>>");

    if(avail==NULL)
    printf("\n\t\t<<<Node is not available>>>");
    else

    {
     newn=avail;
     avail=avail->next;
     printf("\n\t\t<<<<Enter value>>>");
     scanf("%d",&q);
     newn->info=q;
     if(first==NULL)
     {
      newn->next=NULL;
      first=newn;

     }
     else
    {
     newn->next=first;
     first=newn;
     }

     }


     getch();

     goto m;

case 2:
       printf("\n\n\t\t<<YOU HAVE PRESSES 2 FOR INSERT NODE AT LAST.>>");

       if (avail==NULL)
       printf("\n\n\t\t<<Sorry Node is not Available.>>");
       else
       {
    newn=avail;
    avail=avail->next;
    printf("\n\n\t\t<<Enter Value>>");
    scanf("%d",&newn->info);
    newn->next=NULL;
    if(first==NULL)
    {
     first=newn;

    }
    else
    {
    save=first;
    while(save->next!=NULL)
    {
     save=save->next;

    }
    save->next=newn;

    }

       }


    getch();
    goto m;



case 3:
       printf("\n\n\t\t<<YOU HAVE PRESSES 3 FOR INSERT NODE AS ORDER.>>");



       if(avail==NULL)
       printf("\n\n\t\t<<Sorry, Node is not Available>>");
       else

       {
    newn=avail;
    avail->next=avail;
    printf("\n\n\t\t<<Enter Value>>");
    scanf("%d",&newn->info);
    if(first==NULL)
    {

     newn->next=NULL;
     first=newn;
    }
    else
    {

     if(newn->info<=first->info)

     {
      newn->next=first;
      first=newn;

     }
     else
     {
     save=first;
     while(save->next!=NULL&&(save->next)->info<=newn->info)

     {
      save=save->next;
     }
     newn->next=save->next;
     save->next=newn;

     }


    }



       }





       getch();

       goto m;

case 4:
      printf("\n\n\t\t<<YOU HAVE PRESSES 4 FOR DISPLAY.>>");
    getch();
      if(first==NULL)
      {
      printf("\n\n\t\t<<NO NODE IN LINKED LIST >>");
      }
      else
      {
    printf("\n\n\t\t| ELEMENTS |ADD.   |ADD.OF NEXT NODE |\n\n ");

      temp=first;
      while(temp !=NULL)
      {
       printf("\n\t\t|  %d  | |  %u  | |  %u  |",temp->info,temp->next,temp);
       temp=temp->next;

      }
      }
      getch();
      goto m;

case 5:
       printf("\n\n\t\t<<YOU HAVE PRESSES 5 FOR DELETE FIRST NODE .>>");
    getch();
    if(first==NULL)
    {
     printf("\n\t\t NO NODE IN LINKED LIST ");
    }
    else
    {
     save=first;
     first=save->next;
     //save->info=NULL;

     save->next=avail;
     avail=save;
     printf("\n\t\t FIRST NODE DELETED ");

    }


    getch();
    goto m;
case 6:
       printf("\n\n\t\t<<YOU HAVE PRESSES 6 FOR DELETE LAST NODE .>>");
    getch();
    if(first==NULL)
    {
     printf("\n\t\t NO NODE IN LINKED LIST ");
    }
    else
    {
    if(first->next==NULL)
    {
      y=first->info;

      first->next=avail;
      first=avail;
      first=NULL;
    }

    else
    {
     save=first;
     while(save->next!=NULL)
     {

       pred=save;
       save=save->next;

     }
     }
    pred->next=NULL;
    save->next=avail;
    save=avail;
    printf("\n\t\t LAST NODE DELETED ");




    }



    getch();
    goto m;
case 7:
       printf("\n\n\t\t<<YOU HAVE PRESSES 7 FOR DELETE AS OREDER.>>");
    if(first==NULL)
    {

    printf("\n\t\t NO NODE IN LINKED LIST ");
    }
    else
    {
     printf("\n\t\t INSERT VALUE WHICH YOU WANT TO DELETE ");
     scanf("%d",&x);

     if(first->info==x)

     {
     first->next=avail;
     first=avail;
     first=NULL;
     }
     else
     {
      temp=first;
      while(temp->next!=NULL&&temp->info!=x)
      {
       pred=temp;
       temp=temp->next;




      }
      if(temp->info!=x)
      {
       printf("\n\t\t NODE NOT FOUND ");
      }
      else
      {
       pred->next=temp->next;
       temp->next=avail;
       temp=avail;
       printf("\n\t\t NODE DELETED ");

      }


     }



    }


    getch();
    goto m;
case 0:
      printf("\n\n\t\t ");
      printf("\n\t\t   Do you want to exit?   ");
      printf("\n\t\t   Press any key to Exit  ");
      printf("\n\t\t ");
      getch();
      exit(0);

}







getch();

}

HOW TO GET SUM OF DIGIT FOR GIVEN VALUE IN C

#include<stdio.h>
void main()
{
int no,m,sum;
clrscr();
sum=0;
printf("\tenter your value for get sum of digit");
scanf("%d",&no);
while(no>0)
{
m=no%10;
sum=sum+m;
no=no/10;
}
printf("\tsum of your value%d",sum);
getch();
}

HOW TO PERFORM BINARY SEARCH IN C

#include<stdio.h>
#include<conio.h>
void main()
{
 int low=1,mid,high,n=10,k[10],i,x;
 clrscr();
 for(i=1;i<=n;i++)
 {
  printf("\nEnter value:-");
  scanf("%d",&k[i]);
 }
  printf("\n\n\t\tEnter value of you want to search:-");
  scanf("%d",&x);
  high=n;
 while(low<=high)
 {
  mid=(high+low)/2;
  if(x==k[mid])
  {
    printf("\n\nsuccessful search");
    getch();
    return;
  }
  else
  {
   if(x>k[mid])
   {
    low=mid+1;
   }
   else
   {
    high=mid-1;
   }
  }
  }
   printf("\n\n\t\tUnsuccessful search");
   getch();
   }

HOW TO GET ODD AND EVEN NO TO YOUR GIVEN NO

#include<stdio.h>
void main()
{
/*program for get num even or odd
 Date:12\10\2009
made by Dixit Panchal*/
int no,i,index;
clrscr();
printf("enter your value for odd or even untill you want");
scanf("%d",&no);
printf("press 1 for odd number\n");
printf("press 2 for even number");
scanf("%d",&index);
switch(index)
{
case 1:
//odd nos part
//logic of odd nos
printf("\t\t\todd numbers\n\n");
for(i=1;i<no;i=i+2)
{
printf("%d\t",i);
}
break;
case 2:
//even nos part
//logic of even number
printf("\t\t\teven numbers\n\n");
for(i=0;i<no;i=i+2)
{
printf("%d\t",i);
}
break;
}
getch();
}

HOW TO CREATE BUBBLE SORTING FOR GIVEN ARRAY OF VALUES

#include<stdio.h>
#include<stdio.h>
void main()
{
  int i,n=10,k[10],last,exch,temp,pass;
  clrscr();
  for(i=1;i<n-1;i++)
  {
   printf("\n\t\tEnter No:-");
   scanf("%d",&k[i]);
  }
   printf("\n\n\t\tPress any key for sorting........");
   last=n;
   for(pass=1;pass<n-1;pass++)
   {
      exch=0;
     for(i=1;i<last-1;i++)
     {
      temp=k[i];
      k[i]=k[i-1];
      k[i-1]=temp;
      exch=exch+1;
     }
      if(exch==0)
      {

      }
      else
      {
       last=last-1;
      }

   }

   for(i=1;i<n;i++)
   {
    printf("\n\t\t %d ",k[i]);
   }
   getch();
}

HOW TO GET REVERSE DIGIT FROM YOUR GIVEN NO

#include<stdio.h>
#include<conio.h>
void main()
{
  int no,m,rev=0;
  clrscr();
  printf("\t\t\nEnter your value you want get reverse No.\n");
  scanf("%d",&no);
  while(no>0)
  {
    m=no%10;
    rev=(rev*10)+m;
    no=no/10;
    }
    printf("Reverse no %d",rev);
    getch();
}

how to print hello in C language

#include<stdio.h>
#include<conio.h>
void main()
{
    clrscr();
     printf("HELLO DX");
      getch();
}

HOW TO CREATE USER DEFINED FUNCTION IN C

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

void addition(void);
void subtraction(void);
void multiply(void);
void divition(void);
void main()
{
    char name;
    clrscr();
    printf("\tpress A for Addition.\n\n");
    printf("\tpress S for Subtraction.\n\n");
    printf("\tpress M for Multiply.\n\n");
    printf("\tpress D for Divition.\n\n\t");
    name=getchar();
    switch(name)
    {
        case 'A':
        addition();
        break;
        case 'a':
        addition();
        break;
        case 'S':
        subtraction();
        break;
        case 's':
        subtraction();
        break;
        case 'M':
        multiply();
        break;
        case 'm':
        multiply();
        break;
        case 'D':
        divition();
        break;
        case 'd':
        divition();
        break;
        default:
        printf("\tplease re-enter your choise.\n\n");
        printf("\tThank you for chosing  u & i softwere.\n\n\tCreated By Dixit Panchal.\n\n\tpress any key to continues\n");
        break;
     }
getch();
}
    void addition(void)

    {
    int i,u,ans;
    printf("\tplease enter your two value which you want to Addtion.\n\n\t");
    scanf("%d\t%d",&i,&u);
    ans=i+u;
    printf("\tYour answer is = %d",ans);
    }

    void subtraction(void)

    {
    int u,i,ans;
    printf("\tplease enter your two value which you want to Subtraction.\n\n\t");
    scanf("%d\t%d",&u,&i);
    ans=u-i;
    printf("\tYour answer is = %d",ans);
    }

    void multiply(void)

    {
    int u,i,ans;
    printf("\tplease enter your value which you want to Multiply.\n\n\t");
    scanf("%d\t%d",&u,&i);
    ans=u*i;
    printf("\tYour ans is = %d",ans);
    }

    void divition(void)

    {
    int u,i,ans;
    printf("\tplease enter your value which you want to Divition.\n\n\t");
    scanf("%d\t%d",&u,&i);
    ans=u/i;
    printf("\tYour answer is = %d",ans);
    }

HOW TO DROW BELOW PETTERN IN C

"Drow following Pettern in c"
            *
          **
        ***
      ****
    *****
 ----------------------------------------------------------------------------------------------------------
#include<stdio.h>
#include<conio.h>
void main()
{
  int i,j,a;
  clrscr();
  for(i=1;i<=5;i++)
     {
      for(j=5;j>=i;j--)
      {
       printf(" ");
      }
      for(j=1;j<=i;j++)
      {
      printf("*");
      }
    printf("\n");
    }
getch();
}

How to change Background color by selecting color from Listview

activitymain.xml file::> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"     xm...