OCJP

Confirm Password Using C Language

#include<stdio.h>
#include<conio.h>
#include<ctype.h>
void main()
{
char nm[12],aa[12];
int i,f=0,p=0,j;
clrscr();
printf("\nEnter Password:");
scanf("\n%s",nm);
aj:

printf("\n\nEnter Confirm password:");
scanf("\n%s",aa);
for(j=0;aa[j]!=NULL;j++)
{

  }
for(i=0;nm[i]!=NULL;i++)
{
if(aa[i]!=nm[i])
{
p=1;
}
else
{
f=1;
}
}

if(f==1 && i==j)
{
printf("\n Password is same");
}
else
{
printf("\n Password Is not same");
goto aj;
}
getch();
}
//panding

Leave a Reply

Your email address will not be published. Required fields are marked *


× How can I help you?