TOPIC

What is the error?

Tazim asked 6 months ago

#include<stdio.h>
#include<string.h>
#include<math.h>

int main()
{
    int n,i,a,j,c;
    float b;
    char code[1000];
    scanf("%d",&n);
    for(i=0;i<=n;i++)
    {
        gets(code);
        a=strlen(code);
        b=a*1.00/2;
        c=floor(b);
        for(j=0;j<a;j++)
        {
            if((code[j]>=65 && code[j]<=90)|| (code[j]>=97 && code[j]<=122))
            {
                code[j]+=3;
            }

        }
        strrev(code);
        for(j=c;j<a;j++)
        {
            code[j]-=1;
        }

        printf("%s\n",code);

    }

    return 0;
}

This topic has not been answered yet. Be the first!

Remember not post solutions. Your post may be reviewed by our moderators.