Forum Replies Created

Viewing 15 posts - 61 through 75 (of 93 total)
  • Author
    Posts
  • in reply to: Please help #3505
    GWILouisaxwzkla
    Participant

    try:

    in reply to: C Code to extraxct data from a file #3504
    GWILouisaxwzkla
    Participant

    Is the code to be in c or c++? If in C++ you could easily type the proper combinations of input ( for the first line for example ):

    simple but tedious ………

    in reply to: calculate and display mpg in C program #3495
    GWILouisaxwzkla
    Participant

    The average is calculated in the line:

    the compiler sets up a hidden temporary variable to hold the result of ( miles/gallons ) and then sends this result to the printf () function to print it……..

    in reply to: Guessing game: how to quit the game? #3503
    GWILouisaxwzkla
    Participant

    If your in the main function you could just use a return statement , I’d have to see the code , though…

    in reply to: C program that computes the value of ex using a formula #3501
    GWILouisaxwzkla
    Participant

    try:

    I didn’t know how many digit to output so I chose 12 like the example. You can change this by changing the number listed after the ‘.’ in the last printf() statements.

    Theres an error in the code I posted for the approximation of e = 1 + 1/1! + 1/2! . Heres the proper code:

    in reply to: C program that estimates the value of the math constant e #3500
    GWILouisaxwzkla
    Participant

    cout and cin are input and output members of a stream object in the file iostream.h . This header file is associated with c++ programs and the method that most c++ programmers use for input and output. cout stands for “console output” and cin stands for console input. You can use them more easily than printf and scanf :

    for the program , try:

    in reply to: Quick Sort for a Struct #3498
    GWILouisaxwzkla
    Participant

    The structs will form a linked list , correct? The sorting key will be variable amongst the struct field members ( the user will chose a struct member to sort the data on ) ?? Is the list to be “disconnected” for sorting ( structs will be moved and the list reconnected ) or is data to be shifted ( probably easier )…

    in reply to: calculate and display mpg in C program #3493
    GWILouisaxwzkla
    Participant

    Could do:

    in reply to: while statement again! #3491
    GWILouisaxwzkla
    Participant

    could do:

    in reply to: ‘while’ statement ?? #3490
    GWILouisaxwzkla
    Participant

    could do:

    in reply to: C program that reads an integer odd/even? #3488
    GWILouisaxwzkla
    Participant

    could do

    in reply to: inventory mngmt in C #3487
    GWILouisaxwzkla
    Participant

    Not sure exactly what you need , but here is something similar with an array of structs and a library inventory:

    in reply to: Banking #3486
    GWILouisaxwzkla
    Participant

    Could do this:

    output:

    in reply to: Please Help with this Question #3482
    GWILouisaxwzkla
    Participant

    Not quite sure what you needed so I wrote this to read words from the keyboard into a character array. I haven’t tested this code much and the logic could probably be simplified….

    output:

    in reply to: Please help me #3479
    GWILouisaxwzkla
    Participant

    4.

    5.

Viewing 15 posts - 61 through 75 (of 93 total)