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


Edited by happygeek: fixed formatting

13 Years
Discussion Span
Last Post by Killer_Typo
#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.


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.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.