how to declare two integer variables x and y

Please support our C advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Sep 2004
Posts: 4
Reputation: alexmejia92 is an unknown quantity at this point 
Solved Threads: 0
alexmejia92 alexmejia92 is offline Offline
Newbie Poster

how to declare two integer variables x and y

 
1
  #1
Sep 6th, 2004
I really need help I'm student from college and I need to write a C program

a) declare two integer variables x and y

b) let x = 6
c) find y value use the following algebraic formula

y=2x (third power) + 5
Reply With Quote Quick reply to this message  
Join Date: Jul 2004
Posts: 1,749
Reputation: nanosani is an unknown quantity at this point 
Solved Threads: 55
Team Colleague
nanosani's Avatar
nanosani nanosani is offline Offline
Unauthenticated Liar

Re: how to declare two integer variables x and y

 
0
  #2
Sep 6th, 2004
Originally Posted by alexmejia92
a) declare two integer variables x and y
b) let x = 6
c) find y value use the following algebraic formula

y=2x (third power) + 5
a) int x;
int y;

b) y = 6;

c) y = 2 * (x ^3) + 5;
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 4
Reputation: alexmejia92 is an unknown quantity at this point 
Solved Threads: 0
alexmejia92 alexmejia92 is offline Offline
Newbie Poster

Re: how to declare two integer variables x and y

 
0
  #3
Sep 6th, 2004
thank you I really apreciated your help

Alex
Reply With Quote Quick reply to this message  
Join Date: Apr 2004
Posts: 4,443
Reputation: Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future 
Solved Threads: 250
Team Colleague
Dave Sinkula's Avatar
Dave Sinkula Dave Sinkula is offline Offline
long time no c

Re: how to declare two integer variables x and y

 
1
  #4
Sep 6th, 2004
Originally Posted by nanosani
c) y = 2 * (x ^3) + 5;
Why do you exclusively OR x with 3? You may be interested in the pow function.
"One of the methods used by statists to destroy capitalism consists in establishing controls that tie a given industry hand and foot, making it unable to solve its problems, then declaring that freedom has failed and stronger controls are necessary." --Ayn Rand
Reply With Quote Quick reply to this message  
Join Date: Jun 2004
Posts: 436
Reputation: Chainsaw is an unknown quantity at this point 
Solved Threads: 11
Chainsaw's Avatar
Chainsaw Chainsaw is offline Offline
Unprevaricator

Re: how to declare two integer variables x and y

 
0
  #5
Sep 6th, 2004
yeah, that looks like Visual Basic syntax! And, shouldn't x=6, not y=6?

So, since we've gone this far in the homework assignment (I know, we don't do homework, but since we've done it WRONG, lets at least correct it)....

x=6;
y=2*x*x*x+5;

(is it 2 times x to the third or 2x to the third?)
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for C
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC