Friday, September 14, 2007

Make your data more secured !!!





PASSWORD PLEASE



Intro ::....

This program deals with the passwords.... U can know the entire details if u just compile them... This is just a sample program to just make u understand the basic concept.... U can use this program anywhere with some modifications as per ur necessity....


Source Code ::...


/*PROGRAM TO DEAL WITH PASSWORD*/


#include stdio.h
#include conio.h
#include process.h
#include ctype.h

FILE *fp;
int i,j,c[10],opt,pa;
char a[10]=" ",b[10]=" ";
void pass();

void main()
{
g:clrscr();
printf("\n\n\n\t\tENTER YOUR OPTION\n\n\n\n\t1.CHECK PASSWORD\n\n\n\t2.CHANGE PASSWORD\n\n\t");
scanf("%d",&opt);
switch(opt)
{
case 1:
{
fp=fopen("pass.txt","r");
fgets(b,20,fp);
fscanf(fp,"%d",&i);
fclose(fp);
pa=i;
clrscr();
printf("\n\n\n\tPASSWORD PLEASE\n\n\n\t");
for(i=0;i<=20;i++)
{
a[i]=getch();
c[i]=toascii(a[i]);
if(c[i]==13)
{
pass();
exit(0);
}
else
printf("*");
}
}
case 2:
{
clrscr();
printf("\n\n\n\n\tENTER YOUR NEW PASSWORD\n\n\t");
for(i=0;i<=20;i++)
{
b[i]=getch();
c[i]=toascii(b[i]);
if(c[i]==13)
{
fp=fopen("pass.txt","w+");
fprintf(fp,"%s\n%d",b,i);
fclose(fp); goto g;
}
else printf("*");
}
}
}
}

void pass()
{
int k=0;
for(j=0;j<=i;j++)
{
if(a[j]==b[j])
k++;
}
if(pa==i&&k==pa)
printf("\n\n\n\n\n\t\tWELCOME U HAVE ENTERED THE RIGHT PASSWORD");
else
printf("\n\n\n\n\n\n\t\tCHECK YOUR PASSWORD");
getch();
}

Merits ::...

* This program is very helpful as this can be attached with any of ur other programs to improve ur security....
* I personally didnt find any exceptional cases here...
* U can set ur password to any number of digits as passwords... It may contain alphabets digits or numbers...


Sample Output ::....





U can try this out by your self by clicking the link below..... Its really funny... The default password is "vignesh"......

http://www.ziddu.com/download.php?uid=Zqydl5mnZa%2BdlZzzZ6qZnJGla6eZlZ2saA%3D%3D5

http://www.ziddu.com/download.php?uid=aqyam5yub6uZmZTza6qZnJGlb6eZlZ2qbg%3D%3D9


Look Out ::...
This program can be run on any C compiler as this is a C program... Your comments are always welcomed....

I can give u alphabets if u give me DIGITS !!!


1 -- ONe 2 -- tWO 000 -- ZERo




Intro ::...


This program generates or gives alphabets for digits... For eg.. if u enter 200 it gets displayed as " Two hundred " Cool is'nt it.. I took great pain in bringing up this program... Try it out...


Source code :::...




/*PROGRAM THAT GIVES NUMBER IN WORDS*/



#include stdio.h
#include conio.h
#include string.h

char t[40]=" ",u[40]=" ",v[40]=" ",w[40]=" ",y[40]=" ";
void d1(char [9][20],long int );
void d2(char [9][20],char [18][20],long int );
int d3(char [9][20],char [18][20],long int ,char [6],char [3][10]);
void d4(char [9][20],char [18][20],long int ,char [6],char [3][10],int ,int );
void ch(char [9][20],char [18][20],long int ,char [6],char [3][10],int ,int );

void main()
{
int i=0,x,k=0;
long int n,num,z,j;
char a[9][20]={" one"," two"," three"," four"," five"," six"," seven"," eight"," nine"},b[18][20]={" ten"," eleven"," twelve"," thirteen"," fourteen"," fifteen"," sixteen"," seventeen"," eighteeen"," nineteen","twenty","thirty","forty","fifty","sixty","seventy","eighty","ninety"};
char c[3][10]={" hundred"," thousand"," lakh"},an[6]={" and "};
clrscr();
printf("\n\n\n\n\n\n\n\n\n\ENTER THE NUMBER\n\n\t");
scanf("%ld",&n);
num=n;
while(n!=0)
{
n=n/10;
i++;
}
k=i;
switch(i)
{
case 0:
{
printf("zero\n");
break;
}
case 1:
{
d1(a,num);
puts(t);
break;
}
case 2:
{
d2(a,b,num);
puts(t);
break;
}
case 3:
{
x=d3(a,b,num,an,c);
puts(a[x-1]);
break;
}
case 4:
case 5:
{
d4(a,b,num,an,c,k,x);
puts(u);
break;
}
case 6:
case 7:
case 8:
{
z=num;
num=z/100000;
j=num;
ch(a,b,num,an,c,j,x);
strcat(t,c[2]);
strcpy(y,t);
num=z%100000;
if(num==0)
{
if(i==1)
puts(y);
else
{
strcat(t,"s");
puts(t);
}
}
else
{
j=num;
ch(a,b,num,an,c,j,x);
strcat(y,t);
puts(y);
}
break;
}
}
getch();
}



void d1(char a[9][20],long int num)
{
strcpy(t,v);
num%=10;
strcpy(t,a[num-1]);
}

void d2(char a[9][20],char b[18][20],long int num)
{
int i=0,j,k;
strcpy(t,v);
if(num/10==1)
{
num%=10;
strcpy(t,b[num]);
}
else
{
if(num%10==0)
{
num/=10;
strcpy(t,b[num+8]);
}
else
{ while(i<2) k="num%10;" i="1)" j="k;">int d3(char a[9][20],char b[18][20],long int num,char an[6],char c[3][10])
{
int i=0;
i=num/100;
strcpy(t,v);
if(num%100==0)
strcat(a[i-1],c[0]);
else
{
num%=100;
if((num/10)%10==0)
d1(a,num);
else d2(a,b,num);
strcat(a[i-1],c[0]);
strcat(a[i-1],an);
strcat(a[i-1],t);
}
return(i);
}


void d4(char a[9][20],char b[18][20],long int num,char an[6],char c[3][10],int k,int x)
{
int j=0;
long int i,n;
strcpy(u,v);
i=num/1000;
if(num%1000==0)
{
if(k==5)
{
n=num;
num=i;
d2(a,b,num);
num=n;
strcat(t,c[1]);
strcat(u,t);
}
else
{
strcat(a[i-1],c[1]);
strcat(u,a[i-1]);
}
}
else
{
if(k==5)
{
n=num;
num=i;
d2(a,b,num);
num=n;
strcat(u,t);
}
else
strcat(u,a[i-1]);
strcat(u,c[1]);
num%=1000;
n=num;
j=0;
while(n!=0)
{
n/=10;
j++;
}
if(j==1)
{
d1(a,num);
strcat(u,an);
strcat(u,t);
}
else if(j==2)
{
d2(a,b,num);
strcat(u,an);
strcat(u,t);
}
else
{
x=d3(a,b,num,an,c);
strcat(u,a[x-1]);
}
}
}


void ch(char a[9][20],char b[18][20],long int num,char an[6],char c[3[10],int j,int x)
{
int i=0,k;
strcpy(t,v);
while(j!=0)
{
j/=10;
i++;
}
if(i==1)
d1(a,num);
else if(i==2)
d2(a,b,num);
else if(i==3)
{
x=d3(a,b,num,an,c);
strcpy(t,a[x-1]);
}
else
{
k=i;
d4(a,b,num,an,c,k,x);
strcpy(t,u);
}
}




Merits ::...


* This program does not contain any exceptional cases..
* This program is valid upto eight digits and not more..




Sample Output ::....




If u want to try this out personally then clik the link below... Its really fuuny..... Enjoy!!!

http://www.ziddu.com/download.php?uid=aaqcnJesbaudlpbzaqqZnJGlbqeZlZymaQ%3D%3D8

http://www.ziddu.com/download.php?uid=Z6qfmJSnbK%2Bam5zzaKqZnJGlbKeZlZyoaw%3D%3D6

Look out ::...

This program can be run on anyother normal C compilers... Your comments are always welcomed....

Do u have calendar for the year 3000... I have....



FUTURE IS OURS


Intro ::...


This program gives u the entire years calendar for any year strarting from year 0001 to year 5000 to the best of my knowledge... I hope this one of the rarely found and one among the valuable that I have tried out...


Source Code :::....

/*PROGRAM TO PRINT ANY ACADEMIC YEARS CALENDAR*/
#include stdio.h
#include conio.h

FILE *fp;
void ca(int);
int da(int ,int);

void main()
{
int z,i,k=0,m1=1,m2=1,y1=1,y2,j;
char a[7]={'S','M','T','W','T','F','S'};
char b[12][10]={"JANUARY","FEBRUARY","MARCH","APRIL","MAY","
JUNE","JULY","AUGUST","SEPTEMBER","OCTOBER",
"NOVEMBER","DECEMBER"};
long int d=0,y=0;
fp=fopen("calendar.txt","w+");
clrscr();
printf("\n\n\n\n\n\n\n\n\n\n\tENTER THE YEAR\n\n\t");
scanf("%d",&y2);
fprintf(fp,"\tCALENDAR - %d\n\n\n",y2);
while(m1=12&&y1!=y2)
{
m1=1;
y1++;
}
else
m1++;
}
d+=y;
i=d%7;
while(m2<=12)
{
fprintf(fp,"\t\t%s\n\n\n",b[k]);
k++;
for(j=0;j<7;j++)
{
fprintf(fp,"%c\t",a[j]);
}
fprintf(fp,"\n");
ca(i);
z=da(m2,y2);
for(j=1;j<=z;j++)
{
if(i<=6)
{
fprintf(fp,"%d\t",j);
i++;
}
else
{
fprintf(fp,"\n%d\t",j); i=1;
}
}
fprintf(fp,"\n\n\n\n");
m2++;
}
fclose(fp);
getch();
}
void ca(int i)
{
switch(i)
{
case 0:
break;
case 1:
fprintf(fp,"\n\t");
break;
case 2:
fprintf(fp,"\n\t\t");
break;
case 3:
fprintf(fp,"\n\t\t\t");
break;
case 4:
fprintf(fp,"\n\t\t\t\t");
break;
case 5:
fprintf(fp,"\n\t\t\t\t\t");
break;
case 6:
fprintf(fp,"\n\t\t\t\t\t\t");
break;
}
}
int da(int m2,int y2)
{
int x=0;
if(m2<=7&&m2!=2)
{
if(m2%2==0)
x=30;
else
x=31;
}
else if(m2>7)
{
if(m2%2==0)
x=31;
else
x=30;
}
else
{
if(y2%4==0)
x=29;
else
x=28;
}
return(x);
}


Merits ::...

*This program gives the academic calendar for any years calendar
* Includes leap year
*Very helpful in the field of astrology
*Alignment is similar to that u see in your normal wall calendar

Look out ::...

This program can be run in any C compilers... Important thing is that the output will only be displayed in a notepad file outside the compiler... This is because while displaying the entire year's calendar only a last few months are visible in DOS PROMPT after execution.... So in case of notepad file entire years calendar can be displayed.... For eg 2050 calendar will look as follows....
Your comments are always welcomed....




Want to know your age in days....




DATE - DATE ===== ?????



Intro ::..

This program is built to find the difference between of days between the two given dates... The C language is used for its construction... This is the first program that i have tried out with a great grit... I thank my teacher since she is behind its thought...


Source Code ::..


/*PROGRAM TO FIND THE NUMBER DAYS BETWEEN TWO DATES*/


#include stdio.h

void main()
{
int x=0,d1,d2,m1,m2,y1,y2,t;
long int d=0,y=0;
clrscr();
printf("\n\n\n\n\n\tENTER THE FIRST DATE\n\n\t");
scanf("%d%d%d",&d1,&m1,&y1);
printf("\n\n\n\n\nENTER THE SECOND DATE\n\n\t");
scanf("%d%d%d",&d2,&m2,&y2);
if(y1>y2)
{
t=y1;
y1=y2;
y2=t;
t=m1;
m1=m2;
m2=t;
t=d1;
d1=d2;
d2=t;
}
if(y1==y2&&m1>m2)
{
t=m1;
m1=m2;
m2=t;
t=d1;
d1=d2;
d2=t;
}
if(m1<=7&&m1!=2) { if(m1%2==0) x=30; else x=31; } else if(m1>7)
{
if(m1%2==0)
x=31;
else
x=30;
}
else
{
if(y%4==0)
x=29;
else
x=28;
}
if(m1==m2&&y1==y2)
d=d2-d1;
else
{
d=x-d1;
d+=d2;
}
m1++;
while(m1=12&&y1!=y2)
{
m1=1;
y1++;
}
else
m1++;
}
d+=y;
printf("\nthe no of days between the two\ngiven dates are %ld\n",d);
getch();
}


Merits ::...

* I have tried out for almost all possible inputs and there are no exceptional cases...


Sample Output ::....




U can try this program by urself by clicking the link below.... Try this out its really interesting......


http://www.ziddu.com/download.php?uid=aK6am52pa6ualZ2ntayZlJyiZ7CWlJWr7

http://www.ziddu.com/download.php?uid=Y7KanZysaK2fnOKnYaqhkZSrXqqalpas1


Look out ::..

By copying this code and placing it in your any of the C compilers you can exectute the program...