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
Maha
NA
0
328.6k
Two chevron
Sep 28 2013 10:52 AM
This program is given in the following website. Please explain the meaning of the two chevron mark. Problem is highlighted.
http://www.dotnetperls.com/binary-representation
using System;
class Program
{
static void Main()
{
// Write full binary string for 100.
Console.WriteLine(GetIntBinaryString(100));
// Write full binary string for 100000.
Console.WriteLine(GetIntBinaryString(100000));
Console.ReadKey();
}
static string GetIntBinaryString(int n)
{
char[] b = new char[32];
int pos = 31;
int i = 0;
while (i < 32)
{
if ((n
&
(1
<<
i)) != 0)
{
b[pos] = '1';
}
else
{
b[pos] = '0';
}
pos--;
i++;
}
return new string(b);
}
}
/*
00000000000000000000000001100100
00000000000000011000011010100000
*/
Reply
Answers (
7
)
Unable to open doc file after editing in C#
Problem in adding controls dynamically in user control