TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Ken H
NA
646
360.1k
The "for" cyclic of question
Aug 6 2012 10:28 AM
hi friends,
Why output is 10 rather not 9.
Code:
#include<iostream>
using namespace std;
void
main
()
{
const size_t array_size=10;
int ia[array_size];
for (size_t ix=0;ix!=array_size;++ix)
ia[ix]=ix;
cout<<ia[ix]<<
endl
;
}
/*
my logic is:when + + X is equal to 10, you no longer perform the body of the loop statement
right result
cout<<ia[ix]
output is 9,why is output is 10.
*/
thanks.
Reply
Answers (
5
)
How to do permutations and combinations?
ram to run automatically in c