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
SUNIL GUTTA
NA
1k
394k
code snippet ? functionality ??
Jul 25 2013 4:18 PM
Hii
static void Main()
{
int i, j = 1, k;
for (i = 0; i < 5; i++)
{
k =j++ + ++j;
Console.WriteLine(k+" ");
}
Console.ReadKey();
}
In he above code .. i am getting out put as 4 8 12 16 20 ... well its compiler generated output it cant be wrong but the thing is i am confused .. with the block of code
K= j++ + ++J ;
Here acc to pre & post increment operation mechanism say initially j=1 next step j++ it remains 1 only after that ++j it gets 2 so 1+2 should be 3 but y am i getting 4 ..
Hope u got my point TY
Reply
Answers (
15
)
Try, Throw, Catch
How to code for GRidview shown content depends on id ?