473,473 Members | 2,193 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

I Am Down With Viral And Need Help.

27 New Member
hey ppl i am down with viral and have to submit assesment on this friday .
i am new at c programming and have to write a program in it .
------------------------------------------------
A program that repeatedly request an integer from the user and displays the integer as a binary number. It should terminate when the value 9999 is entered. A typical run might look like:
Enter integer: 16
00000000000000000000000000010000
Enter integer: -1
11111111111111111111111111111111

--------------------------------------------------------------------------------------------------------
PLEASE HELP ME COZ IF I DONT SUMBIT IT THAN I WILL LOSE MARKS AND I AM IN NO CONDITION TO DO IT AS I AM ON ANTIBIOTICS AND DONT HAVE STRENGTH .
i know there are many experts here in ANSI C , and wont take a sweat for u guys to do it , please help me , will appreciate your help very very much.
thanks
Oct 19 '06 #1
2 1161
D_C
293 Contributor
You don't have the strength to do it? I don't think so...

I'll still give you C++ code though that prints an integer as binary.
Expand|Select|Wrap|Line Numbers
  1. void printBinary(int input)
  2. {
  3.   for(int i = 31; i >= 0; i--)
  4.     cout << ((input && (1 << i)) >> i);
  5.   cout << endl;
  6. }
I haven't tested it, but it seems simple enough.
Oct 19 '06 #2
marsguy85
27 New Member
Ansi C ................
Not C++
And I Swear I Am Down Wid Viral And Taking Antibiotics ! So Sleeping All Day Like Shit .
Thanks Anyway But Its In Ansi C Not C++ Forgot To Mention It Sorry.
Oct 19 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Mr. Long Island | last post by:
I'm looking to promote my site and need a Viral Marketing Program. Thanks! johnniemacusa@longislandxtra.com
46
by: Kingdom | last post by:
In my data base I have a list of componet types e.g. type A - I have 8 off - type B I have 12 off etc. I'm using Set objRS = objDC.Execute("Select DISTINCT Component_Type FROM Parts_Table") ...
13
by: Leszek Taratuta | last post by:
Hello, I have several drop-down lists on my ASP.NET page. I need to keep data sources of these lists in Session State. What would be the most effective method to serialize this kind of data...
7
by: callawayglfr | last post by:
I am building a database in access where I have a drop down box that relates to a text box, that part I have working but when someone selects information from the first drop down I need it to limit...
3
by: cpptutor2000 | last post by:
Could some PHP guru please help me? I am have a drop down list, whose options are read in dynamically from a table in a MySQL database. one of the items being read in is an URL. I am unable to...
1
by: ashok76 | last post by:
Hi I've a DataGridView and where has column 0 is a DataGridViewComboBoxColumn Whenever I selected that cell then the drop down list not appeared on single click event hence I need to click again...
0
by: tusaar | last post by:
Hi all I am in big need for a drop down menu created with php, mysql and ajax. Exactly, I need three drop down menu (Category, Subcategory and Item). The data of each drop down will come from...
0
by: ShowyardDeveloper | last post by:
I am new to developing web sites, and need some help. How do I: When a customer is going through my questionaire they can pick how many varities of plants they want (say they want 5 different...
2
by: registry | last post by:
<%@Language="VBSCRIPT" CODEPAGE="1252"%> <html> <head> <title>Registry Network Hospital Detail</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <script...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.