Program in C to find weekday based on weekday number

The below program in C will find out weekday based on the weekday number input. We will be following the below logic.
1 -> Sunday
2 -> Monday
3 -> Tuesday
4 -> Wednesday
5 -> Thursday
6 -> Friday
7 -> Saturday

Here we are accepting the week day number as input from the user and use switch statement to display the weekday.

Below is the program in C.

Output

Operations on Pointers in C

The only operations that can be carried out on pointers in C are summarized below:

  1. A pointer variable in C can be assigned the address of an ordinary variable (e.g., pv = &v)
  2. A pointer variable can be assigned the value of another pointer variable (e.g., pv = px) provided both the pointers point to objects of the same data type
  3. A pointer variable in C can be assigned a null (zero) value (e.g., pv = NULL, where NULL is a symbolic constant that represents the value 0)
  4. An integer quantity can be added to or subtracted from a pointer variable (e.g., pv = 3, ++pv, etc)
  5. One pointer variable can be subtracted from another provided both pointers point to elements of the same array
  6. Two pointer variables in C can be compared provided both pointers point to objects of the same data type

For demo on pointer operations in C, visit http://www.learnconline.com/2010/06/pointer-operations-demo-in-c-programming.html