Hi guys!
Im creating a program where i want the user to type a password with atleast one uppercase letter! The code is working when i type uppercase letter only on the beginning for example "Banana" . But when i type uppercase letter in the middle " baNana" it isnt working.
Help plz?
Code:
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
int main()
{
char a[10];
int i;
printf("Enter your password: ");
for (i=0;i<10;i++)
{
scanf("%s",&a[i]);
if (!isupper(a[i]))
{
printf("\nYour password must contain atleast 1 uppercase");
}
else { printf("\nPassword Good!"); }
}
return 0;
}