- 2
Please tell me to trick solve password validation program
3 odpowiedzi
+ 2
The trick is to use search bar, there are many threads on this subject.
+ 2
Learn to take input in strings and compare it..Learn how to use loops..
C program of password Validation
#include <stdio.h>
main()
{
char s[100];
scanf("%s",&s);
int i,length ,numbers=0, special_characters=0;
length=strlen(s);
for(i=0;i<length;i++){
if(s[i]>='0'&&s[i]<='9'){
numbers++;
}
else if(s[i]=='!'||s[i]=='@'||s[i]=='#'||s[i]=='#x27;||s[i]=='%'||s[i]=='&'||s[i]=='*'){
special_characters++;
}
}
if(length>=7 && special_characters>=2 && numbers>=2){
printf("Strong");
}
else {
printf("Weak");
}
}
You can try this one..
.
0
Read the description carefully, try to implement to code.. If you stuck between, then ask here with sharing code..
Tricks in programming, I don't understand what you mean? There is no tricks programming.. except predefined functions if any suitable for a given problem..