Trying to print using an (array)?

This is a discussion on Trying to print using an (array)? within the C Programming forums, part of the General Programming Boards category; I'm pretty new at programming, so I'm not sure if it's called an array exactly, but I want to print ...

  1. #1
    Registered User
    Join Date
    Oct 2011
    Posts
    9

    Exclamation Trying to print using an (array)?

    I'm pretty new at programming, so I'm not sure if it's called an array exactly, but I want to print my output so it does the following:

    The ball strikes at:
    x m
    b m
    y m

    So far I have written a piece of my code in a forloop which follows (keep in mind that this is a small piece of a bigger program):

    Code:
    for(i = 1; i<=num_hits; i++)
             {
                 points = (double)d_distance*cos(theta*(M_PI/180))*i;
                     printf("The ball will hit the lower wall at the following point %.3lfm\n", points);            
             }
    Mine prints out, of course like
    The ball will hit the lower wall at the following point: x m
    The ball will hit the lower wall at the following point: y m
    The ball will hit the lower wall at the following point: z m

  2. #2
    Registered User
    Join Date
    Oct 2011
    Posts
    9
    Damnnn, it isn't letting me delete this. ):

  3. #3
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    That's right... none of us get to delete any post more than an hour old.
    We got real tired of people coming here getting our help then wiping out the entire context of the conversation.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Can't seem to print an array, HELP !
    By Demonoid in forum C Programming
    Replies: 13
    Last Post: 03-06-2011, 05:59 PM
  2. Print a 2D Array
    By xxshankar in forum C Programming
    Replies: 3
    Last Post: 03-11-2010, 08:29 PM
  3. Replies: 2
    Last Post: 04-27-2008, 04:39 AM
  4. i want to print a array
    By timhxf in forum C Programming
    Replies: 2
    Last Post: 01-07-2007, 04:25 AM
  5. print an array
    By Dr Spud in forum C Programming
    Replies: 6
    Last Post: 11-27-2005, 05:44 AM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21