Thread: How to write a program that is able to do simple cross products (C89)?

  1. #1
    Registered User
    Join Date
    Feb 2017
    Posts
    1

    How to write a program that is able to do simple cross products (C89)?

    Hello everyone.

    I'm trying to write a program that does simple cross multiplication.

    Cross-multiplication - Wikipedia

    I would like to write it using C 89 and compile it using GCC in Ubuntu 14.04.

    A feature that I would like to have is to make the display in terminal using columns and lines. I would like to see the solution update dynamically if i change any values.

    I don't know where to start.

    Do you have any tip or sample code that can help me to solve this problem?

    Thank you very much for your time,

    Greetings,

    Ortiz

  2. #2
    Registered User
    Join Date
    Jun 2015
    Posts
    1,640
    Quote Originally Posted by chicortiz View Post
    I would like to write it using C 89 and compile it using GCC in Ubuntu 14.04.
    Why do you want it in C89. What's wrong with C99?

    A feature that I would like to have is to make the display in terminal using columns and lines.
    How else can something be displayed in a terminal except in columns and lines?

    I would like to see the solution update dynamically if i change any values.
    In what sense do you want it to "update dynamically"?

  3. #3
    Registered User
    Join Date
    Jun 2011
    Posts
    4,513
    Quote Originally Posted by chicortiz View Post
    Hello everyone.
    Hello.

    Quote Originally Posted by chicortiz View Post
    A feature that I would like to have is to make the display in terminal using columns and lines. I would like to see the solution update dynamically if i change any values.

    I don't know where to start.
    I would start by determining the logic for the cross-multiplication and developing that code. The link you posted looks like a good starting point.

    After you have that working, you can start focusing on making the interface look "nicer".

    You need to define what you mean by seeing the solution update "dynamically". If you're talking about having the output "updated" in-place instead of re-printed below the previous output, you need to look into OS-specific functions or third-party libraries (e.g. ncurses).

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Could someone please write a simple program for me?!
    By danjer242 in forum C++ Programming
    Replies: 1
    Last Post: 03-28-2010, 10:43 PM
  2. Can any one write a simple C Program 4 this??
    By sriki in forum C Programming
    Replies: 30
    Last Post: 12-03-2007, 03:48 PM
  3. Vectors, dot products, cross products etc
    By cboard_member in forum Game Programming
    Replies: 4
    Last Post: 08-18-2006, 09:24 AM
  4. I want to write a simple program in C++ to...
    By Danhash in forum Windows Programming
    Replies: 3
    Last Post: 03-07-2003, 01:38 PM
  5. how to write simple C program?
    By edwardkys in forum C Programming
    Replies: 3
    Last Post: 11-22-2002, 05:50 PM

Tags for this Thread