1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Rep Power

    Output each character from array!

    Hey guys,

    I had in my last exam this question and my answer was 100% false. Can someone help me?? Thank you...!

    The question was:

    Complete the following segment of code to make it output each character from the start of the declared array(not implemented as a string) up to but excluding any asterik(*) character. The array should be output. Only one while loop containing one putchar() statement may be used.

    d Code:
    #define ARRAYSIZE 100
    int main(void){
    char array[ARRAYSIZE];
    int index;
    /*assume statements to input the array from the */
    /*user have already been coded and included here */
    index = 0;
    /*put your code in here*/
    return =0;
  2. #2
  3. Contributing User
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Aug 2011
    Rep Power
    You probably failed because you didn't replace line 12 with code.

    Please show your work!
    [code]Code tags[/code] are essential for python code and Makefiles!

IMN logo majestic logo threadwatch logo seochat tools logo