write a c program to Create a mail account by taking the
username, password, confirm password, secret_question,
secret_answer and phone number. Allow users to register,
login and reset password(based on secret question). Display
the user accounts and their details .

Answer Posted / puneet mittal

#include<stdio.h>
#include<conio.h>
#include<string.h>
main()
{
char username[20][20],username1[20][20],answer[20][20];
int password[5],password1[5],password2[5],phno[5],n,i;
int confirmpassword[5],ans;
char qst[20][20];
char secretanswer[20][20];
printf("Number of user to create a mail account :");
scanf("%d",&n);
for(i=0;i<n;i++)
{
printf("\nusername :");
scanf("%s",username[i]);
pass:
printf("\npassword :");
scanf("%d",&password[i]);
printf("\nconfirm password:");
scanf("%d",&confirmpassword[i]);
if(password[i]==confirmpassword[i])
{
printf("Enter secret Question :");
scanf("%s",&qst[i]);
printf("Enter secret Answer:");
scanf("%s",&secretanswer[i]);
printf("Phone number :");
scanf("%d",&phno[i]);
}
else
{
printf("\n Repassword doesn't
match.Retype your password and confirm it again.");
goto pass;
}
printf("\n\nRegistration Succesful");
}
for(i=0;i<n;i++)
{
printf("\nLog in Account : \n");
pass1 :
printf("\nusername : \t");
scanf("%s",username1[i]);
printf("password :\t");
scanf("%d",&password1[i]);

if((password1[i]==password[i])&&((strcmp(username1[i],username[i])==0)))
{
printf("you want to reset your
password say 1/0 :");
scanf("%d",&ans);
if(ans==1)
{
pass2:
printf("answer the following : ");
printf("%s:",qst[i]);
scanf("%s",answer[i]);

if((strcmp(secretanswer[i],answer[i])==0))
{
printf("Enter new password :");
scanf("%d",&password2[i]);
}
else
{
printf("sereat answer is wrong ,
TRY AGAIN .");
goto pass2;
}
password[i]=password2[i];
printf("account detail :");
printf("username :%s",username[i] );
printf("\nPassword
:%d",password[i] );
printf("Phone number : %d
",phno[i]);
}
else
if(ans==0)
{
printf("account detail :\n\n");
printf("\n username
:%s\n",username[i] );
printf("\n Password
:%d\n",password[i] );
printf("\n Phone number : %d\n
",phno[i]);
}
}
else
{
printf("\nUsername or password
is wrong, TRy AGAIN. ");
goto pass1;
}
}
getch();
}

Is This Answer Correct ?    11 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

create a C-code that will display the total fare of a passenger of a taxi if the driver press enter,the timer will stop. Every 10 counts is 2 pesos. Initial value is 25.00

6297


Given a spherical surface, write bump-mapping procedure to generate the bumpy surface of an orange

2849


How to palindrom string in c language?

8781


Write a Program in 'C' To Insert a Unique Number Only. (Hint: Just Like a Primary Key Numbers In Database.) Please Some One Suggest Me a Better Solution for This question ??

1764


What is the match merge ? compare data step match merge with proc sql merge - how many types are there ? data step vs proc sql

2395






why nlogn is the lower limit of any sort algorithm?

2362


How can I Create a C program in splitting set of characters to specific subsets. Example: INPUT SET OF CHARACTERS: Therefore, my dear brothers and sisters, stand firm. Let nothing move you. Always give yourselves fully to the work of the Lord, because you know that your labor in the Lord is not in vain. SPLIT INTO HOW MANY CHARACTERS PER SUBSETS: 10 OUTPUT: Therefore, my dear b rothers an d sisters, stand fir m. Let not hing move you. Alway s give you rselves fu lly to the work of t he Lord, b ecause you know that your labo r in the L ord is not in vain.

1916


Hi, i have a project that the teacher want a pyramid of numbers in C# or java...when we click a button...the pyramid should be generated in a listbox/or JtextArea...and the pyramid should have the folowing form: 1 232 34543 4567654 567898765 67890109876 7890123210987 890123454321098 90123456765432109 0123456789876543210 Plz help with codes...didn't find anything on the net.

2667


What is data _null_? ,Explain with code when u need to use it in data step programming ?

2808


#include int main(void) { int a=4, b=2; a=b<>2 ; printf("%d",a); return 0; }

1060


What is the difference between proc means and proc tabulate ? explain with a simple example when you have to use means or tabulate?

3697


What is full form of PEPSI

1849


Write a routine to implement the polymarker function

4367


Sir... please give some important coding questions asked by product companies..

1788


A program that will create a movie seat reservation. The program will display the summary seats and its status. The user will be ask what seat no. to be reserved, then it will go back again to the summary to display the updated seat status. If the seat no. is already reserved then it will prompt an error message. And also if the input seat no is out of range then it will also prompt an error message. The program is continuously running. Termination of the program will depends on how the programmer will apply. Sample output: Movie Seats Reservation Summary of Seats: Seat 1: Available Seat 2: Available Seat 3: Available Seat 4: Available Seat 5: Available Enter seat no. (Press 0 to terminate Or the assigned seat capacity) : 1 Movie Seats Reservation Summary of Seats: Seat 1: Reserve Seat 2: Available Seat 3: Available Seat 4: Available Seat 5: Available Enter seat no. (Press 0 to terminate Or the assigned seat capacity) : 6 The Seat no. is out of range! Movie Seats Reservation Summary of Seats: Seat 1: Reserve Seat 2: Available Seat 3: Available Seat 4: Available Seat 5: Available Enter seat no. (Press 0 to terminate Or the assigned seat capacity) : 1 The Seat no. is already reserved! Movie Seats Reservation Summary of Seats: Seat 1: Reserve Seat 2: Available Seat 3: Available Seat 4: Available Seat 5: Available Enter seat no. (Press 0 to terminate Or the assigned seat capacity) : 0 GoodBye... Thank You!!!

1827