Multiple choice c

what is the best choice to print the value of variable x where:

int x = 123;

  1. printf("%f",x);

  2. printf("%d",x);

  3. printf("%c",x);

  4. printf("%s",x);

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The variable x is declared as an int. The correct format specifier for an integer in printf is %d. %f is for float/double, %c is for char, and %s is for strings.