GOT STUCKED(ERRORS) @ CHALLENGE # 1

+1 katti kartikeyareddy · January 18, 2015
#include<stdio.h>
#include<conio.h>
#include<ctype.h>
#define $,#,%,&,*,! == charecters
main()
{
    char password[14],k;
    printf("\n\n\t\tEnter your password:");
    scanf("%s",&password);
    if(isalpha(password) && isupper(password) && (password==charecters))
    {
        printf("\n\n\t\tYou password is now ready to go!!");
    }
    else
    {
        printf("\n\n\t\tCheck it properly...once man!!");
    }
}

Post a Reply

Replies

Oldest  Newest  Rating
0 katti kartikeyareddy · February 13, 2015
#include<stdio.h>
#include<conio.h>
#include<string.h>
int is_upper(char a);
void main()
{
    char n[20];
    printf("Enter your password:");
    scanf("%s",n);
    int u=0,l=0,d=0;
    int i;
    for(i=0;i<strlen(n);i++)
    {
        if(is_upper(n)==1)
            u=1;
        if(n>=97&&n<=122)
            l=1;
        if(n>=47&&n<=57)
            d=1;
    }
    if(u!=1)
        printf("No Uppercase!\n");
    else if(d!=1)
        printf("No digit!\n");
    else
        printf("Ok!");
}
int is_upper(char a)
{
    if(a>=65&&a<=90)
        return 1;
    else
        return 0;    
}
0 c student · January 18, 2015
you have:
conio.h is not standard
incorrect macro #define
non-return type main
scanf's password array should have no ampersand
your isupper and isalpha function is used incorrectly with your password array
'charecters' is undeclared on line 9, col 57
k is unused variable
(optional) scanf return type is ignored

are you sure you know what you're doing?  maybe you need to find a better explanation of c somewhere else?
  • 1

C

107,188 followers
About

One of the most popular languages of all time.

Links
Moderators
Bucky Roberts Administrator