In a contest my following programme is proving wrong ,,,,But why ?

0 votes
asked Jan 11, 2018 by zenia
#include<stdio.h>
 

int main()
{
    int T,AB,AC,R=1,I;
    scanf("%d",&T);
    printf("\n");

    if(T<=100)
    {
        for(I=1;I<=T;I++)
         {
             scanf("%d%d",&AB,&AC);
             if(1<=AB&&AC<=100)
             {

         R=((AB*AB)+(AC*AC));
         printf("Case %d: %d\n",I,R);
             }
         }
    }
    return 0;
}

2 Answers

0 votes
answered Jan 11, 2018 by anonymous
I think you should share problem statement.
0 votes
answered Jan 24, 2018 by Robayet Al Hamim (270 points)

if(1<=AB&&AC<=100)

there's the problem :)

Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...