***PRACTICE EXAM 01 for***
CS16 Midterm Exam 1
E01, 09S, Phill Conrad, UC Santa Barbara
Actual exam scheduled for: 10/21/2009

Solution to question 3



expression
value
type
3
     
     3   
       
   int       double        char         char *      
0.5 * 0.5

0.25

   int       double        char         char *      
'3'

'3'

   int       double         char         char *      
"3"

"3"

   int       double         char         char *      
1 / 10

              0             

    int         double         char         char *      
5 / 2.0

              2.5             

   int       double           char         char *      
26 % 5

              1             

     int         double         char         char *      
5 % 2

              1             

    int          double         char         char *      
1.0 / 10

              0.1             

   int         double              char         char *      
1 + 3 * 5

             16              

     int          double         char         char *      
1 + 1 / 2

             1              

     int        double         char         char *      
 
 2.0 / 4.0 + 0.5 

             1.0              

   int        double            char         char *