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
Smart Lucky
NA
555
638.6k
Problem in Converting Decimal to Binaray
Jun 15 2011 2:53 AM
Hi
i am trying to convert decimal to binary but problem is that it is not giving me proper result can any one help me.....?
program is below..
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BinarayNumber
{
class Program
{
static void Main(string[] args)
{
Console.Write("Please Enter any number......");
int number = int.Parse(Console.ReadLine());
int reminder, value = 0;
string binaray = null;
for (int i = 0; i <= number; i++)
{
reminder = number % 2;
value = number / 2;
number = value;
Console.WriteLine("Reminder is {0} , Value is {1} , Number is now {2}", reminder, value, number);
reminder += value;
binaray += reminder;
}
Console.WriteLine("Binray value is is" + binaray);
Console.ReadKey();
}
}
}
Reply
Answers (
3
)
anybody help me for creating login page in asp.net
Voice chat development in asp.net