Write a c program which takes password from user





Write a c program which takes password from users

C source code for password:

#include<stdio.h>
#define MAX 500

int main(){

    char password[MAX];
    char p;
    int i=0;

    printf("Enter the password:");
   
    while((p=getch())!= 13){
         password[i++] = p;
         printf("*");
    }

    password[i] = '\0';

    if(i<6)
         printf("\nWeak password");

    printf("\nYou have entered: %s",password);

    return 0;
}

Sample output:
Enter the password:*******
You have entered: fgt67m,





1. Write a c program to convert decimal number to hexadecimal number.
3. Write a c program to convert octal number to decimal number.
4. Write a c program to convert octal number to hexadecimal number.
5. Write a c program to convert hexadecimal number to decimal number.
6. Write a c program to convert hexadecimal number to octal number.
8. Write a c program to convert binary number to hexadecimal number.
9. Write a c program to convert binary number to octal number.
11. Write a c program to convert hexadecimal number to binary number.
12. Write a c program to convert octal number to binary number.
14. Write a c program to convert centigrade to fahrenheit.

18 comments:

Anonymous said...

Password program is not running.. plz check.. I need this program.

Anonymous said...

The Above Program is Executed Correctly., But it will take Garbage Values as input too...

punit sharma said...

program that accepts user name from user and password by using command line arguments.
user name should be declare in array in the program.if we entered wro0ng username it have to give ,username is wrong on output screen?

punit sharma said...

program that accepts user name from user and password by using command line arguments.
user name should be declare in array in the program.if we entered wro0ng username it have to give ,username is wrong on output screen?

Ankan Mondal said...

just use a getch() command in place of return 0 ....It will work

aman said...

just include header file conio.h, it will work

jason jason said...

what do the (while(xxxxx)!=13)mean?do 13 means something?

jitendra kumar said...

plz explain while((p=getch())!= 13)

jitendra kumar said...

i understood 13 is ascii value of enter key

sravani singamneni said...

It is executed i had checked

AATHAVAN THIRAVIAM said...

Plz explain while statement.......

AATHAVAN THIRAVIAM said...

really...

Ram Prudhvi said...

plse send me a programme for below questions
1. Write a C program to take details of 5 books (title, authors, pages, price) using Structures,
-order them based on the names by passing structure array to a function using pointers.(Ordering the records must be done using pointers.)
-Search for book that has a combination of authors.

The India said...

iso registration in delhi
iso 22000 certification cost
ISO 9001 Certification in Noida
website designing services
SEO Service Consultant

The India said...

iso registration in delhi
iso 22000 certification cost
ISO 9001 Certification in Noida
website designing services
SEO Service Consultant

The India said...

we have provide the best fridge repair service.
fridge repair in faridabad
Videocon Fridge Repair in Faridabad
Whirlpool Fridge Repair in Faridabad
Hitachi Fridge Repair In Faridabad
Washing Machine Repair in Noida
godrej washing machine repair in noida
whirlpool Washing Machine Repair in Noida
IFB washing Machine Repair in Noida
LG Washing Machine Repair in Noida

The India said...

we have provide the best ppc service.
ppc company in gurgaon
website designing company in Gurgaon
PPC company in Noida
seo company in gurgaon
PPC company in Mumbai
PPC company in Chandigarh
Digital Marketing Company

The India said...

Rice Bags Manufacturers
Pouch Manufacturers
wall putty bag manufacturers
fertilizer bag manufacturers
seed bag manufacturers
gusseted bag manufacturers
bopp laminated bags manufacturer
Lyrics with music