Write a C code that ask the user to enter his ID, if the ID is valid it will
ask the user to enter his password, if the password is correct the
program will print the user name, if the password is incorrect the
program will print Incorrect Password.
In case of not existing ID, the program will print Incorrect ID
(using switch case)
this is my code please help I cannot get the required
#include <stdio.h>
void main(void)
{
int ID;
int pass;
printf("Plese Enter Your ID: ");
scanf("%d",&ID);
printf("Enter your password: ");
scanf("%d",&pass);
switch(ID)
{
case 470:
printf("Welcome Mahmoud");
break;
switch(pass)
{
case 602:
printf("Welcome Mahmoud");
}
default :
printf("incorrect password");
break;
}
}
ask the user to enter his password, if the password is correct the
program will print the user name, if the password is incorrect the
program will print Incorrect Password.
In case of not existing ID, the program will print Incorrect ID
(using switch case)
this is my code please help I cannot get the required
#include <stdio.h>
void main(void)
{
int ID;
int pass;
printf("Plese Enter Your ID: ");
scanf("%d",&ID);
printf("Enter your password: ");
scanf("%d",&pass);
switch(ID)
{
case 470:
printf("Welcome Mahmoud");
break;
switch(pass)
{
case 602:
printf("Welcome Mahmoud");
}
default :
printf("incorrect password");
break;
}
}