Insights Blog
-- Browse All Articles --
Physics Articles
Physics Tutorials
Physics Guides
Physics FAQ
Math Articles
Math Tutorials
Math Guides
Math FAQ
Education Articles
Education Guides
Bio/Chem Articles
Technology Guides
Computer Science Tutorials
Forums
Intro Physics Homework Help
Advanced Physics Homework Help
Precalculus Homework Help
Calculus Homework Help
Bio/Chem Homework Help
Engineering Homework Help
Trending
Featured Threads
Log in
Register
What's new
Search
Search
Search titles only
By:
Intro Physics Homework Help
Advanced Physics Homework Help
Precalculus Homework Help
Calculus Homework Help
Bio/Chem Homework Help
Engineering Homework Help
Menu
Log in
Register
Navigation
More options
Contact us
Close Menu
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
.
Forums
Homework Help
Engineering and Comp Sci Homework Help
Assigning a variable using a unary operator
Reply to thread
Message
[QUOTE="Crystal037, post: 6856268, member: 660555"] [B]Homework Statement:[/B] I am using unary operator inside while loop to assign values, but it isn't doing doing anything [B]Relevant Equations:[/B] None [code=c]int a[]={12,34,55,76,89,23}; int n=5; while(n>1){ a[n]=a[--n];} for(int i=0;i<6;i++){ printf("%d\t",a[i]); }[/code] [B][COLOR=rgb(41, 105, 176)]Mentor note[/COLOR][/B][COLOR=rgb(41, 105, 176)]: Please use code tags in future posts. I've added them to this code.[/COLOR] The above code should shift the element values to the right of each array cell, but after running the code it doesn't seem to be doing anything. [ATTACH type="full" alt="Screenshot (147).png"]322464[/ATTACH][ATTACH type="full" alt="Screenshot (147).png"]322464[/ATTACH] [/QUOTE]
Insert quotes…
Post reply
Forums
Homework Help
Engineering and Comp Sci Homework Help
Assigning a variable using a unary operator
Back
Top