I did small changes in your code.Now the program is working fine.You execute it and revert me if any problem occurs.
Code:
#include<iostream.h>
#define MAXSIZE 100
void dec2bin(int n)
{
    int i,bin[MAXSIZE],t,i1=0;
    for(i=0;n>=1;i++)
    {
        t=n%2;
        n=n/2;
        i1++;
        bin[i]=t;
    }
    for(i=(i1-1);i>=0;i--)
        cout<<bin[i];
    cout<<"\n";
}
main()
{
int x;
cout<<"Enter a number to convert it into binary :";
cin>>x;
cout<<"The Binary Equivalent is :";
dec2bin(x);
}

Last edited by shabbir; 27Feb2010 at 12:41.. Reason: Code blocks