My photo
Bangalore, Karnataka, India
Extending one hand to help someone has more value rather than joining two hands for prayer

Archives

program of password, where you write your password and it print in the form of stars

Tuesday, September 1, 2009

#include<iostream.h>
#include<conio.h>
#include<string.h>
#include<process.h>
void main()
{    clrscr();
     cout<<" type'exit'for out of program"<<endl;
     char str[]="dhami",x[]="exit",m[50];
     int i,j,k;
     cout<<"enter the code ";
     label:
     i=0;
     while((m[i]=getch())!='\r')
     {    cout<<"*";
      i++;
               }

     m[i]='\0';
     j=strcmp(str,m);
     k=strcmp(x,m);


     if(j==0)
     {    cout<<"\nhello";
      getch();
      exit;         }
     else
     {    cout<<"\ninvalid try again  ";
      if(k==0)
      exit;
      else
      goto label;                    }
 }

0 comments: