#Challenge 1 Solved :)

0 Suraj Gautam · June 3, 2015
Thank you all my friends, brothers and specially Bucky. I feel proud because I am able to complete this challenge provided by expert Bucky ;)


#include <stdio.h>
#include <conio.h>
#include <ctype.h>
void main ()
{
char passwd[30];
int i=0, upper=0, digit=0, sign=0;
printf("Enter your password\n\n");
scanf("%s",passwd);
while(i< 30)
{
if(isupper(passwd)){
upper=1;
}
if(isdigit(passwd)){
digit=1;
}
if(passwd=='$'){
sign=1;
}
i++;
}
if(upper==1 && digit==1 && sign==1)
{
printf("Your password is great");
}
else{
printf("Your password sucks");
}
getch();
}




In case of error, check this: http://ideone.com/BrJYw9


Post a Reply

Replies

Oldest  Newest  Rating
0 Vladimir Djukic · June 4, 2015
You forgot passwd, if you leave passwd it will chack every time full string.....
0 Suraj Gautam · June 5, 2015
VLadimir I didnt get you?
0 Vladimir Djukic · June 5, 2015
this comments don't work good... in every if statment should be like this: 
if(isdigit(passwd[]))
0 c student · June 6, 2015
there's a bug where the index i is applied as an italics formatting.  you can see this if you look closely at your own post.

also i highly suggest you use int main if you're going to stick with c
0 Suraj Gautam · June 6, 2015
http://ideone.com/BrJYw9 check this brothers


The code is missing in this post :(
0 c student · June 6, 2015
you pasted your code as java
+1 rasen itachi · June 7, 2015
Nice job
  • 1

C

107,342 followers
About

One of the most popular languages of all time.

Links
Moderators
Bucky Roberts Administrator