Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

a)Write a program that prompts the user to enter an 8-character password, then p

ID: 3542917 • Letter: A

Question

a)Write a program that prompts the user to enter an 8-character password, then prints the characters back to the screen along with their corresponding ASCII values.

b) Modify  the program. determine if the password entered matches  the characters a)Write a program that prompts the user to enter an 8-character password, then prints the characters back to the screen along with their corresponding ASCII values.

b) Modify  the program. determine if the password entered matches  the characters b) Modify  the program. determine if the password entered matches  the characters

Explanation / Answer

// PROGRAM A is:
#include<stdio.h>
#include<string.h>
int main()
{
int i=0;
char password[8];
printf("Enter password :");
scanf("%s",password);
for(i=0; i<strlen(password); i++)
{
printf(" %c corresponding ASCII value is %d ",password[i],password[i]);
}
return 0;
}

// PROGRAM B to see password matches to APSC1413 or NOT.

#include<stdio.h>
#include<string.h>
int main()
{
int i=0;
char password[8];
printf("Enter password :");
scanf("%s",password);
if(strcmp(password,"APSC1413")==0)
printf(" Your password is Valid.");
else
printf(" Your password is not Valid.");
return 0;
}


Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote