"hamoodmeero" <[EMAIL PROTECTED]> wrote:
> 
> WELL ALL I WROTE IN THE TEST QUESTION IS THIS,
> SO PLEASE CAN U CORRECT ME  AND TELL ME WHERE
> IS THE MISTAKE ?....THNXX :

For someone dealing in secrets, you sure make a lot of noise!

If you can avoid holding the shift or caps locks when coding,
please do the same with your emails.

> #include<stdio.h>
> 
> int main()
> {
>       char alpha[26]=
> 
{'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q',
> 'R','S','T','V'.'U','W','Y','Z'}
>       char a[26]=
> 
{'J','P','F','L','X','O','C','M','S','E','B','N','G','Q','D','R','U',
> 'V','W','K','T','Y','A','H','I'}
>       char code[60];
>       printf(" ENTER THE CODE  :  ");
>       scanf("%s",&code);
>       for(int i=0 ; i<26 ; i++)
>              if(alpha[i]==a[i])

Why would this condition be true? Look at your initialisation...

  alpha[ 0] == 'A'   a[ 0] == 'J'
  alpha[ 1] == 'B'   a[ 1] == 'P'
  ...
  alpha[26] == 'Z'   a[26] == 'I'

You're asking if 'A' == 'J', or if 'B' == 'P', etc...

>                code[alpha];

This is a valid statement, but a useless one since it
has no side effects. It doesn't assign a value or
perform any output.

> 
>       return 0 ;
> }

-- 
Peter

Reply via email to