About for loop statement

in #art5 years ago

未标题-1.jpg
After compiled and ran for this code.When i input 1 on control,then control output 2.At first i do not understand that why control output 2.
No long after,i understand because that the program must carry the i++ statement.So control output 2.
The code as follows:
#include"stdio.h"
#include"stdlib.h"
main(){

int i;
for(i=3;i<=6;i++){
    printf("%d\n",i);
    scanf("%d",&i);
}
system("pause");

}
捕获.PNG

Sort:  

Welcome sky-999!
eSteem is mobile and desktop application that improves your experience on Steem.

Download Android and iOS apps. Surfer Desktop application that helps you to gain new followers and stay connected with your friends, unique features - notifications, bookmarks, favorites, drafts, and more.
We reward our users with encouragement upvotes as well as ESTM token.
Learn more: https://esteem.app
Join our discord: https://discord.me/esteem

Congratulations @sky-999! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

You received more than 10 upvotes. Your next target is to reach 50 upvotes.

You can view your badges on your Steem Board and compare to others on the Steem Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

Vote for @Steemitboard as a witness to get one more award and increased upvotes!

Welcome to steemit @sky-999.

Welcome the new steemians. Have a great day!

According to the Bible, In Matthew 17: 1-5, was Matthew in the mountain with Jesus?

(Sorry for sending this comment. We are not looking for our self profit, our intentions is to preach the words of God in any means possible.)



Comment what you understand of our Youtube Video to receive our full votes. We have 30,000 #SteemPower. It's our little way to Thank you, our beloved friend.
Check our Discord Chat
Join our Official Community: https://beta.steemit.com/trending/hive-182074