954,499 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

please help me

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
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

alexmejia92
Newbie Poster
4 posts since Sep 2004
Reputation Points: 12
Solved Threads: 0
 
#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.

Dave Sinkula
long time no c
Team Colleague
5,058 posts since Apr 2004
Reputation Points: 2,780
Solved Threads: 314
 
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.

Killer_Typo
Master Poster
781 posts since Apr 2004
Reputation Points: 152
Solved Threads: 39
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You