Challenge #1

+1 Mohamed Nehad · July 11, 2015
Hi ,,


I wrote a program code by 'C' .. 


This program verify the password which the user entered , and get sure that it contains "$" , "Number" and "Letter".


#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <math.h>
#include <string.h>
int main()
{
  char x[8];
    int y=0,z=0,f=0;
    printf( "Enter proper PW contains [ Letters , num. , and symbol $ ]\n ");
    scanf(" %s" ,x);

for (  y=0 ; y<=8 ; y++)
{
    if ( x[y] != '$' ) { continue;}
    else {

        for (z=0 ; z<=8 ; z++)
        {
            if ( isdigit(x[z]))
            {
                for ( f=0 ; f<=8 ; f++)
                {
                    if ( isalpha(x[f]))
                    {
                        printf("Good Password"); break;
                    }
                    else { continue; }

                }
                break;
            }
             if ( f==9){
                    printf("enter letters plz"); break; }
            else  { continue; }
        }
                    if ( z==9 ) { printf("Plz enter Digits"); break;}

    break;}
    }
if ( y==9) { printf("Plz password must contain symbol [ $ ] ");}


return 0;
}



You opinion will help :) so feel free to say it ! Thanks.

Post a Reply

Replies

Oldest  Newest  Rating
+1 Pudge P-Pod · July 12, 2015
Hi There,
Your program worked just fine for me.  Good Job.
0 Mohamed Nehad · July 18, 2015

:: Pudge P-Pod


Hi There,

Your program worked just fine for me. Good Job.




Oh great ! :) Thanks for your replay.
  • 1

C

107,322 followers
About

One of the most popular languages of all time.

Links
Moderators
Bucky Roberts Administrator