can any one write code to find out if array is sorted in ascending order from even to odd number or not ? i will be thankful . i am new self learner of c++.
Thanks in ADVANCE
az.rathore
0
Newbie Poster
Recommended Answers
Jump to Postis sorted in ascending order
for(int i=1;i<sizeOfArray;++i) { if (array[i]>array[i-1]) { //Looking good... } else { std::cout << "Not sorted :("; break; } }
from even to odd number or not ?
I have no idea what you mean by this.
Jump to PostDo you know how to
1) check if a value is even or odd?
2) check if one value is < or > the next number?
3) move through an array from one number to the next?
All 5 Replies
Moschops
683
Practically a Master Poster
Featured Poster
az.rathore
0
Newbie Poster
WaltP
2,905
Posting Sage w/ dash of thyme
Team Colleague
az.rathore
0
Newbie Poster
WaltP
2,905
Posting Sage w/ dash of thyme
Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.