Skip to main content
Engineering LibreTexts

6.3: Exercises

  • Page ID
    35827
  • Exercise \(\PageIndex{1}\)

    Write the code to declare an array of 12 single precision real numbers.

    Exercise \(\PageIndex{2}\)

    Write the code to declare an array of 15 eight bit signed integers.

    Exercise \(\PageIndex{3}\)

    Assume that an array of 100 double precision real numbers has been declared and is named points. Write the code to print out the first item of points. Also, write the code to set the last item of points to 0.0.

    Exercise \(\PageIndex{4}\)

    Declare a string called mammal and initialize it to the word woodchuck.

    Exercise \(\PageIndex{5}\)

    Do you see any potential problems with this snippet of initialization code? If so, explain the issues and how they might be corrected.

    char bird;
    
    bird[0]=’s’
    bird[1]=’w’
    bird[2]=’a’
    bird[3]=’l’
    bird[4]=’l’
    bird[5]=’o’
    bird[6]=’w’ 
    
    • Was this article helpful?