Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C++ and Visual C++ > C++ Programming
| Search | Today's Posts | Mark Forums Read
C++ Programming General discussions for the C++ language. For questions specific to Microsoft's Visual C++ variant, see the Visual C++ forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C++ Programming section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old July 30th, 2003, 07:07 AM
Authorized User
 
Join Date: Jun 2003
Location: rawalpindi, panjab, Pakistan.
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to arshad mahmood
Default Please answer these questions(urgent)

Hello Sir.
how r u.please answer these questions if it is possible for u .if u not know anyone of these answers then donot answer.it is urgent.
i shall be thankful to you.

Question
what is the output of the following program of c/c++;

void main(void)
{
union
{
unsigned short a;
struct
{
unsigned char b;
unsigned char c;
}st;
}un;
un.st.b = 2;
un.st.c = 3;
printf("\n %x \n",un.a);}

Question
which of the following statement performs 2's compliment
a) x=~x+1;
b) x=-x;
c) A and b Both



Question
What is the simplest way of testing whether number is even or odd.
Note :: number % 2 is not an option



arshad mahmood
__________________
arshad mahmood
Reply With Quote
  #2 (permalink)  
Old July 30th, 2003, 01:11 PM
Authorized User
 
Join Date: Jul 2003
Location: , , .
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Do your homework yourself. And for your information

void main(void)

is unacceptable.
Reply With Quote
  #3 (permalink)  
Old August 23rd, 2003, 02:11 AM
Registered User
 
Join Date: Aug 2003
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I think Ans is No 2

Reply With Quote
  #4 (permalink)  
Old August 24th, 2003, 05:38 PM
Authorized User
 
Join Date: Jun 2003
Location: Colgate, WI, USA.
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Ammiel Send a message via AIM to Ammiel Send a message via MSN to Ammiel
Default

The sad thing is he's showing he doesn't have a good C++ book.... buy Ivor Horton's Beginning C++ or The C++ Programming Language by Bjarne Stroustrup; Now that's how you should help :) Oh and sir is politically incorrect :)
Reply With Quote
  #5 (permalink)  
Old August 30th, 2003, 11:49 PM
Registered User
 
Join Date: Aug 2003
Location: Houston, Texas, USA.
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Perhaps you could compile the program and see the results for yourself?

Anyway, noone like to see people post their homework. It's *your* work, not ours.

Please feel free to ask questions, of course, but bear in mind that you will not learn anything unless you apply yourself.

Cheers.

"The process of preparing programs for a digital computer is especially attractive, not only because it can be economically and scientifically rewarding, but also because it can be an aesthetic experience much like composing poetry or music." - Donald Knuth
Reply With Quote




Similar Threads
Thread Thread Starter Forum Replies Last Post
Interview questions(Urgent) balesh.mind ASP.NET 2.0 Professional 5 April 4th, 2008 03:51 AM
Really Urgent(SEI CMM Level 5) questions balesh.mind ASP.NET 2.0 Professional 0 September 13th, 2007 01:25 AM
answer IvAnR C++ Programming 1 July 22nd, 2005 08:01 AM
moderators to answer questions on a regular basis statusquo BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 2 June 3rd, 2005 10:09 PM
two questions.. urgent desprate VB How-To 1 April 7th, 2005 12:13 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.