#include<stdio.h>
#include<conio.h>
/******************************************
Develop By Girfa
Visit : http://girfahelp.blogspot.in/2012/09/some-program-of-c-language.html
*******************************************/
void main()
{
char pass[20],ch;
int i,number,special,capital,small;
number=special=capital=small=0;
clrscr();
printf("Enter Password>> ");
gets(pass);
for(i=0;pass[i]!='\0';i++)
{
if(pass[i]>='0' && pass[i]<='9')
number=1;
if(pass[i]>='a' && pass[i]<='z')
small=1;
if(pass[i]>='A' && pass[i]<='Z')
capital=1;
if(pass[i]=='!' || pass[i]=='@' || pass[i]=='#' || pass[i]=='$' || pass[i]=='%' || pass[i]=='*')
special=1;
}
if(number==0 || special==0 || capital==0 || small==0)
printf("\n\tInvalid Password");
else
printf("\n\tValid Password");
getch();
}
#include<conio.h>
/******************************************
Develop By Girfa
Visit : http://girfahelp.blogspot.in/2012/09/some-program-of-c-language.html
*******************************************/
void main()
{
char pass[20],ch;
int i,number,special,capital,small;
number=special=capital=small=0;
clrscr();
printf("Enter Password>> ");
gets(pass);
for(i=0;pass[i]!='\0';i++)
{
if(pass[i]>='0' && pass[i]<='9')
number=1;
if(pass[i]>='a' && pass[i]<='z')
small=1;
if(pass[i]>='A' && pass[i]<='Z')
capital=1;
if(pass[i]=='!' || pass[i]=='@' || pass[i]=='#' || pass[i]=='$' || pass[i]=='%' || pass[i]=='*')
special=1;
}
if(number==0 || special==0 || capital==0 || small==0)
printf("\n\tInvalid Password");
else
printf("\n\tValid Password");
getch();
}
How do you do this in While Loop not for loop
ReplyDeleteCan you please tell me how to do this program in while loop
ReplyDeleteI=1
DeleteWhile(pass[I]!='0')
{
_____
_____
I++
}