473,395 Members | 1,915 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Comparison of two integers

hi !

i am working with this assignment which is to create a program..to compare
two integers to see if it's an even or an odd number..
it accept only 1 input from the user..
the catch is to do this without using any condition statement...
can not use if..else, for loop, switch or any other condition statement..
Really appreciate you help...
ro********@hotmail.com
Jul 21 '05 #1
2 1100
odd = cbool(num1 and 1)
even = not odd(num1)

"roody" <ro***@discussions.microsoft.com> escribió en el mensaje
news:1F**********************************@microsof t.com...
hi !

i am working with this assignment which is to create a program..to compare
two integers to see if it's an even or an odd number..
it accept only 1 input from the user..
the catch is to do this without using any condition statement...
can not use if..else, for loop, switch or any other condition statement..
Really appreciate you help...
ro********@hotmail.com

Jul 21 '05 #2
You're not asking us to do your homework for you, are you? ;)

/Joakim

roody wrote:
hi !

i am working with this assignment which is to create a program..to compare
two integers to see if it's an even or an odd number..
it accept only 1 input from the user..
the catch is to do this without using any condition statement...
can not use if..else, for loop, switch or any other condition statement..
Really appreciate you help...
ro********@hotmail.com

Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

29
by: Bart Nessux | last post by:
Just fooling around this weekend. Wrote and timed programs in C, Perl and Python. Each Program counts to 1,000,000 and prints each number to the console as it counts. I was a bit surprised. I'm not...
43
by: michael.f.ellis | last post by:
The following script puzzles me. It creates two nested lists that compare identically. After identical element assignments, the lists are different. In one case, a single element is replaced. In...
4
by: Mike Duffy | last post by:
I just recently realized that the comparison operator "is" actually works for comparing numeric values. Now, I know that its intended use is for testing object identity, but I have used it for a...
20
by: chutsu | last post by:
I'm trying to compare between pointer and integer in an "IF" statement how do I make this work? if(patient.id != NULL){ } Thanks Chris
5
by: evanevankan2 | last post by:
I have a question about the warning 'comparison between signed and unsigned' I get from my code. It comes from the conditional in the outer for loop. I understand the warning, but I'm not sure...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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,...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.