Home / Questions / What is wrong in this statement? scanf("%d",whatnumber);
Explanatory Question

What is wrong in this statement? scanf("%d",whatnumber);

👁 3,390 Views
📘 Detailed Answer
🕒 Easy to Read
Read the answer carefully and go through the related questions on the right side to improve your understanding of this topic.

Answer with Explanation

An ampersand & symbol must be placed before the variable name whatnumber. Placing & means whatever integer value is entered by the user is stored at the "address" of the variable name. This is a common mistake for programmers, often leading to logical errors.