944,027 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Unsolved
  • Views: 1552
  • C RSS
Sep 8th, 2004
0

please help me

Expand Post »
I need to write a C program

(a) declare two integer variables , and y

(b) lex x = 6

(c) find y value use the following algebraic fromula:
y=2*x*x*x+5


and I only have until these part

#include <stdio.h>
int main ()
{

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

I don't know what to put next, [lease help me with my homework

thanks
Reputation Points: 12
Solved Threads: 0
Newbie Poster
alexmejia92 is offline Offline
4 posts
since Sep 2004
Sep 8th, 2004
0

Re: please help me

#include <stdio.h>
  
  int main(void)
  {
     int x = 6, y = 2 * x * x * x + 5;
     printf("x = %d, y = %d\n", x, y);
     return 0;
  }
  
  /* my output
  x = 6, y = 437
  */
Man... open a book.
Team Colleague
Reputation Points: 2780
Solved Threads: 312
long time no c
Dave Sinkula is offline Offline
4,790 posts
since Apr 2004
Sep 8th, 2004
0

Re: please help me

Quote originally posted by Dave Sinkula ...
Man... open a book.
can not stress that enough, programming is somthing you can not expect to learn without using a book, weather it be a book on programming it self, or a book with just example snipets, you will need a book and need one often. books on engineering, software design, anything you can think of related to programming are always good things to read, and you can get them at your local library for free, just check it out, read it, and return it. if you need it again, check it out again. if you find its a book that you will need often, just purchase ur own copy of it.
Reputation Points: 152
Solved Threads: 39
Master Poster
Killer_Typo is offline Offline
778 posts
since Apr 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: how to declare two integer variables x and y
Next Thread in C Forum Timeline: I'm complete lost





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC