Help me in solving Hello problem

My issue

how to code this question in c language

My code

#include <stdio.h>

int main() {
int t;
while(t--)
{
   int a,b,X;
   
   scanf("%d %d %d ",&a,&b,&X );
   printf("Enter a and b values");
   printf("enter X value");
  
}


int a,b,X;
if(  2*a + 2*b+a*b == X)
{
    printf("yes");
    X++;
}
else{
    printf("no");
    
    
}
return 0;
}



Learning course: Roadmap to 3*
Problem Link: https://www.codechef.com/learn/course/klu-roadmap-3star/KLURMP302/problems/HLEQN

  1. The variable t is not assigned a value, so the while(t–) loop might cause undefined behavior.
  2. The variables a, b, and X are declared multiple times.
  3. There is an extra space in your scanf function.

Correct code

include <stdio.h>

int main() {
int t; // Number of test cases
printf(“Enter the number of test cases: “);
scanf(”%d”, &t); // Input for the number of test cases

while (t--) { // Loop through each test case
    int a, b, X;
    printf("Enter values for a, b, and X: ");
    scanf("%d %d %d", &a, &b, &X); // Input values for a, b, and X

    // Check the condition
    if (2 * a + 2 * b + a * b == X) {
        printf("Yes\n");
    } else {
        printf("No\n");
    }
}

return 0;

}