Exercises
1. Which of the following are invalid constants? Why?
123.456 0x10.5 0X0G10001 0xFFFF 123L0Xab05 0L -597.25123.5e2 .0001 +1298.6F 98.7U 17777s0996 -12E-12 077771234uL 1.2Fe-7 15,0001.234L 197u 100U0XABCDEFL 0xabcu +123
2. Write a program that converts 27° from degrees Fahrenheit (F) to degrees Celsius (C) using the following formula:
C = (F - 32) / 1.8
Note that you don’t need to define a class to perform this calculation. Simply evaluating the expression will suffice.
3. What output would you expect from the following program?
#import <Foundation/Foundation.h>int main (int argc, char ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access