vault backup: 2024-11-05 11:43:30
This commit is contained in:
@ -34,6 +34,17 @@ int main(void)
|
||||
> **15.** Suppose that a program needs to display messages in either English, French, or Spanish. Using conditional compilation, write a program fragment that displays one of the following three messages, depending on whether or not the specified macro is defined.
|
||||
|
||||
```c
|
||||
#ifdef ENGLISH
|
||||
#define MESSAGE "Insert Disk 1"
|
||||
#endif
|
||||
|
||||
#ifdef FRENCH
|
||||
#define MESSAGE "Inserez Le Disque 1"
|
||||
#endif
|
||||
|
||||
#ifdef SPANISH
|
||||
#define MESSAGE "Inserte El Disco 1"
|
||||
#endif
|
||||
|
||||
printf(MESSAGE);
|
||||
```
|
Reference in New Issue
Block a user