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

Recommended Answers

All 2 Replies

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.