Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
Kandy
Welcome all my all new pet shop Bark.lk
dilumrane
Updated:
Yesterday at 12:26 PM
Windows RDP Only Rs.500 a month
Blogerwiki
Updated:
Sunday at 12:41 PM
Ad icon
V2ray VPN for Tunneling
hu KANNA
Updated:
Oct 22, 2026
FREE SEO Check & Google Maps Check for Sri Lankan Businesses | Web Design, Website Price Rs 14,900 |
LankaSolve
Updated:
Oct 20, 2026
ඕනම රටකට සෙට් වෙන CV එකක්
ErMurazor
Updated:
Oct 17, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
ElaKiri Help
Write a C++ Program...
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="viraj_slk" data-source="post: 7369060" data-attributes="member: 51932"><p>integer input 3 will shift each number by 3 places (not two). so the output should be like on your original question.</p><p></p><p>3,4,5,1,2</p><p></p><p>[PHP]</p><p>arr[1,2,3,4,5] // current array </p><p>new_arr[] // new array we are going to build</p><p>int p; // the new position for each element in array</p><p></p><p>for(i= 0; i < n; i++){</p><p> p = (i + x)%n; // remember n is the number of values in array & x is user input value</p><p> </p><p> new_arr[p] = arr[i]; </p><p>} </p><p>[/PHP]</p><p></p><p>The above is the code solution to your problem. The only thing you have to do is put the right syntax's. I will post the code later but you would have done nothing on your part other than copy and paste. </p><p></p><p>Write down your problem on paper and think of this solution, try to figure it out. I will write the code later tonite. dont have time now.</p></blockquote><p></p>
[QUOTE="viraj_slk, post: 7369060, member: 51932"] integer input 3 will shift each number by 3 places (not two). so the output should be like on your original question. 3,4,5,1,2 [PHP] arr[1,2,3,4,5] // current array new_arr[] // new array we are going to build int p; // the new position for each element in array for(i= 0; i < n; i++){ p = (i + x)%n; // remember n is the number of values in array & x is user input value new_arr[p] = arr[i]; } [/PHP] The above is the code solution to your problem. The only thing you have to do is put the right syntax's. I will post the code later but you would have done nothing on your part other than copy and paste. Write down your problem on paper and think of this solution, try to figure it out. I will write the code later tonite. dont have time now. [/QUOTE]
Insert quotes…
Verification
Haya warak paha keeyada? (haya wadi kireema paha)
Post reply
Top
Bottom