Question from the Language C - Fundamentals test

Write a C program to calculate the total number of sweets.

Medium

What does the following code display?

int main() 
{
       int caramel = 8;
       int tagada  = 6;
       int sweets= caramel + tagada;
       printf(“We will eat %f sweets”, sweets); 
       return 0;
}
Author: KahinaStatus: PublishedQuestion passed 181 times
Edit
2
Community Evaluations
developer avatar
Frédéric
11/05/2023
Fait chier, j'ai fait confiance au cast implicite d'un int affiché sous format flottant et j'ai répondu 14!!! C'est l'inconvénient de coder proprement en C, comme on ne fait jamais ce genre de connerie on ne peut pas dire ce qui se passera si on le fait...