How many times ‘x’ value will be tested in the following code snippet ?
int x;
for(x=0;x < 10; x++)
printf("%d",x);
To me it seems that the answer is 11 but my module says it is 10 ?! what am I missing?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Eleven, as the condition is tested at the beginning of each loop iteration, before printf is called: