Question: #include / / Function to print the name of the day of the week void printDayName ( int day, int month, int year ) {
#include
Function to print the name of the day of the week
void printDayNameint day, int month, int year
Array to store the names of the days of the week
char daysSunday "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday";
Array to store the number of days in each month
int daysInMonth;
Check if the year is a leap year adjusting for KSA time
if year && year year
daysInMonth; February has days in a leap year
Calculate the total number of days since January st
int totalDays ;
for int i ; i month ; i
totalDays daysInMonthi;
totalDays day;
Adjust for the year leap year
totalDays ;
Calculate the day of the week Sunday, Monday, Saturday
int dayOfWeek totalDays ;
Print the name of the day of the week
printfThe day of the week for ddd is s
day, month, year, daysdayOfWeek;
int main
int day, month, year;
Input the day, month, and year from the user
printfEnter the day : ;
scanfd &day;
printfEnter the month : ;
scanfd &month;
printfEnter the year eg: ;
scanfd &year;
Call the function to print the day of the week
printDayNameday month, year;
return ;
Implement Eight of the following Nine Tasks marks
a Show the Variables in the stack.
b Show the parameters in the stock.
c Show the value of old EIP return address stored in
the stack frame.
d Show the value of old EBP stored in the stack frame,
ie EBP of the caller function
e Address stored in the EIP register.
f Address stored in the EBP register.
g Address of the stack pointer ESP.
h Address stored in the instruction pointer address of
the code that will be executed next
i Content of the instruction registers the code that is
currently being executed
note: we want debug in the task using gdb peda" in kali linux
please help we need it today becuase we have to submit it
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
