C Homework
C Homework
Write a
program in 'C' which returns the outcome of an Exclusive OR operation performed on its two
operands.
Solution:
2. Write a program in C to show that Right shift effectively divides a number by 2 and a left shift
effectively multiplies a number by 2.
Solution:
3. Using if else statement write a program in 'C' to read two integers from the user and display the
quotient. Your program should be able to detect divide by zero.
Solution:
4. Use the concept of macro with parameter (define a macro for area of rectangle) and call that
macro in main program to calculate area of rectangle for given length and width.
Solution:
5. Define a Function-like Macro using? operator and call that to calculate minimum of two given
numbers.
6. Write a program that creates enumerated data type for 7 days of week and shows values of
those days in integer constants.
Solution: