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
jc mandapat
NA
16
0
Efficiency of Loop Statements
Aug 26 2006 11:17 PM
Can anyone help me with this problem.Let's sat I want to loop 10 employees using the foreach statement.Under the foreach i have 3 functions that computes their wages,tax and deductions. My question is this.which is more efficient? 1. for every 1 employee, I compute their wages, tax and deductions Ex. Foreach (X in dsEmployees) { Compute Wages(); Compute Taxes(); Compute Deductions(); } 2. I compute all the wages for all employees, all taxes for all employees and all deductions for all employees Ex. Foreach (X in dsEmployees) { Compute Wages(); } Foreach (X in dsEmployees) { Compute Taxes(); } Foreach (X in dsEmployees) { Compute Deductions(); } can anyone help? thanks!
Reply
Answers (
4
)
FREE .Net material - www.DotNetGuide.net
Reading Excel in C#