Help me in solving GSCP16 problem

##code is not running

My code

// Debug the given code

#include <stdio.h>

int main() {
    int t;
    int N;
    int i = 1;
    scanf("%d", &t );
    while ( i <= t) 
        scanf("%d", &N);
        printf("%d\n", 2*N );
        i = i+1;
  return 0;
}

Learning course: C for problem solving - 1
Problem Link: CodeChef: Practical coding for everyone

your while loop is not doing what you want. Your while loop fixed:

while ( i <= t) {
    scanf("%d", &N);
    printf("%d\n", 2*N );
    i = i+1;
}

Curly brackets are used to define code blocks. You not using them in your solution would be equivalent to this:

while ( i <= t) {
    scanf("%d", &N);
}
printf("%d\n", 2*N );
i = i+1;

Which will cause an infinite loop for obvious reasons.

ohh I didnt notice i was missing the brackets. Thank you .