Write a c program which takes password from users

// author:ankit gehlot
//website:http://ankitcguru.blogspot.com/
 
#include<stdio.h>
#define MAX 500
int main(){
char password[MAX];
char p; //character declaration
int i=0;//intiger declaration
printf("Enter the password:");
while((p=getch())!= 13)//while loop
{ password[i++] = p;
printf("*");
}
password[i] = '\0';
if(i<6) //condition
printf("\nWeak password");
printf("\nYou have entered: %s",password);
return 0;//return value
}

Comments

Popular posts from this blog