Why this code is not acceptable?

#include<stdio.h>
void main(){
int T;
long long int L,D,S,C,i=1,l=0;
scanf("%d",&T);
while(T–)
{
scanf("%lld %lld %lld %lld",&L,&D,&S,&C);
while(i<=D)
{
l+=S;
i++;
}
if(l>=L)
printf(“ALIVE AND KICKING”);
else
printf(“DEAD AND ROTTING”);
}
}

Declare i and l inside the while loop

You are missing an escape sequence “\n” in your printf statements, which results in printing all the outputs in the same line.

There are few reasons why your code doesn’t get accepted .

(i) You have not initialized i and l every time in loop . This will lead to wrong answer because in the loop it may not run enough number time or even once . You need to initialize i every time .

(ii) You are not outputting the answer in correct manner . You need to put \n or newline character so that each output comes in a new line .

An advice is to use c++ instead of c .

//