00:01
Hello students, so here is the c code for the given problem.
00:03
To create a structure named date having day, month and year as its element and we can use the following c code.
00:10
Struct date so this is the structure of the date it having the elements int date, int month and int year.
00:16
So this is the structure we have created in the c language.
00:19
To store the current date in the structure we can use the following code.
00:23
So here struct date current date so i have created the tag for the structure.
00:28
Structure type data so this is current date and the current date .day 7 current date .month is 11 and current date .year is 2023.
00:41
To add the 75 to the current date we can use the following code.
00:45
So we have to add the 75 days.
00:48
So in days we will add so here struct date final date so here struct date here another data type is created for the structure that is final date and final date is equal to current date so this is assigned here.
01:04
Now final date .day here in the final date .day 75 will be incremented.
01:11
So both of these are same so now this final date in this 75 is incremented.
01:20
Handle cases when the final date is in the next month or the year.
01:24
If final date .day is greater than 30 then final date .day will be final date .day minus 30 and final date .month will be incremented and if final date .month is greater than 12 it means final date .month we will assign 1 and the final date .year will be incremented because it is greater than 12.
01:48
Now to display the final date we can use the following code.
01:52
So final date %day %day %day and here hyphen symbol is coming final date .day final date .month final date .year this structure type of data will be printed here.
02:05
Here is a complete code for the complete example of the code so here studio .txt file is taken struct date.
02:14
Date is a structure type data.
02:16
Struct type date is created.
02:19
So here day month and year are taken.
02:21
Now the main function so here struct date is the structure type data and here struct date is the name of the structure and current date is the structure type data.
02:30
So here current date or day 7 so here value is assigned 7.
02:34
Here for month value is assigned 11 and for year value is assigned 2023.
02:41
Now struct date final date is here created another structure type data and it is equal to current date.
02:48
Now final date .day is incremented by the 75...