Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

need a flowgrorithm for this code: #include #include #include #include void password_read(char password[]); int password_check(char password[]); int main(){ char password[100]; int sum; password_read(password); sum =

need a flowgrorithm for this code:

#include

#include

#include

#include

void password_read(char password[]);

int password_check(char password[]);

int main(){

char password[100];

int sum;

password_read(password);

sum = password_check(password);

if (sum) {

printf("Your password is correct ");

}else {

printf("Your password is lackinging ");

}

system("pause");

return 0;

}

//reads the users input

void password_read(char password[]) {

printf("Enter password: ");

printf("Password need to be Uppercase, Digit and $ symbol: ");

scanf("%s", password);

}

//Password need to be Uppercase, Digit and $ symbol

//Password need to be Uppercase, Digit and $ symbol

int password_check(char password[]) {

int upper = 0;

int digit = 0;

int dollar = 0;

int i;

for (i = 0; i < strlen(password); i++) {

if (isupper(password[i])) {

upper = 1;

}

else if (isdigit(password[i])) {

digit = 1;

}

else if (password[i] == '$') {

dollar = 1;

}

}

return (upper && digit && dollar);

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction to Wireless and Mobile Systems

Authors: Dharma P. Agrawal, Qing An Zeng

4th edition

1305087135, 978-1305087132, 9781305259621, 1305259629, 9781305537910 , 978-130508713

More Books

Students also viewed these Programming questions