Any body intrested for puzzels in c++ or C.
By tmaheshwari
@tmaheshwari (170)
India
7 responses
@amgupta (274)
• India
15 Jan 07
here is one puzzle..for those who have heard about it might seem very simple....
Suppose k is an integer, you have to count the numbers of 1's in the binary representation of number k. Use as less number of iterations as u can....
Just an hint, it could be done in a less than statements with out any loop.
@tmaheshwari (170)
• India
19 Jan 07
Hi Dholey,
In your given example, you loop will iterate by total number of bits in the given data type.
for example of a 'int' it will iterate 32 times on a 32 or 64 bit operating system.
In my example, i will interate only total number of '1' in the given number...
For any bit, the probablity of being '1' or '0' is just half, so the complexity of your algorithm is just double of mine.
@tmaheshwari (170)
• India
16 Jan 07
I dont know how to do it in less than a statement.... but
this will also work...
int n = 34; // number for which we have to find total '1', u can change it
int i = 0;
do {
++i;
while(n=(n&(n-1));
cout
@TheApparition (337)
• India
13 Jan 07
Yes. I am interested.
Well I am working on one now..It is related to graphics.Herez the description:
I need to plot a graph (a 2-D)using hexadecimal(ex:0x5A) values on Y axis against some integers on the X axis . The plotting must happen continuously with screen refreshing it self every 5 seconds.(This would look like an oscilloscope refreshing).
Assume the hexadecimal values are available continuously.
@tmaheshwari (170)
• India
13 Jan 07
is it your problem and you want some type of help? If yes then please let me know the equation by which u will use your x and y values to draw the graph. if the quardratic equation is 1:1 then ....
suppose,
your data is like
int x-axis[] = {a, b, c, d, e}; // some integer value
int y-axis[] = {f, g, h, i, j}; // some hexadecimal value
now u can draw your graph like....
int i = 0;
while (i
@tmaheshwari (170)
• India
14 Jan 07
no need for thanks buddy. I like to discuss technical things. But I m new to this web site and i does not know, how to collect all the guys who want same discussion. So that we can share and increase our knowledge?
@dholey (1383)
• India
18 Jan 07
I AM DAM DAM DAM INTERESTED please start puzzle section as soon as possible , i will also help you to add my puzzles there, i have started one unfortunately i haven't got responses there so i am not able to give answer there too. it will be fun, you please start discussion on puzzle we will change our noted there ... and ... nice to be your friend ... i am happy to have gr8 person like you.
@tmaheshwari (170)
• India
19 Jan 07
thanks dholey.... :)
can u please suggest me on how to post new puzzel... can i post new puzze l under 'computing' or should i post it using 'programming' tab??
I mean, how it is possible that the moment i post the puzzel, all the other intrested people will get to know this easily?
@tmaheshwari (170)
• India
19 Jan 07
is it not possible that we create a seprate group on mylot for this type of discussion only and intrested people can join it and participate init on regular basis?
As i m new to mylot, i do not know too much about it. I think you must a lot of friends which must be intrested to join such a group. we can grow if we take such a step. What do u think?
@paki143 (793)
• Pakistan
14 Jan 07
yes i am interested in that types of puzzles i am doing graduation in computer science and i learn c language last month so i am enjoying in making c programs and puzzles
@tmaheshwari (170)
• India
14 Jan 07
very good. okai... so be ready to solve puzzels. I will post them under 'programming' tag.
@gamers2000 (71)
• Singapore
19 Jan 07
Well,I'm not too good in C,but I'll be intrested in PHP ones... :D
@tmaheshwari (170)
• India
19 Jan 07
Nice gamers, i m also intrested in PHP or can say web designing..
i will happy if you can activly participate in the question/answer of PHP or web designing related Queries.
Thanks for your reply.
@tmaheshwari (170)
• India
14 Jan 07
thanks for the reply. Then i will post some puzzel under 'programming' tag.
@uniquecomputers (110)
• India
14 Jan 07
Yes ! I am interested in doing such work. I also do some research and development works too.
@tmaheshwari (170)
• India
14 Jan 07
thanks for your intrest. Can you help me out then? As you can see, i m new to this web site and but i m good in Problem solving skills and c/c++. I want to discuss these things here but i does not know what is the best way to know all the guys who are intrested for the same?
Do you know any community on this web site so that i can join that and activily participate?