write a program in C that prompts the user for today's
date,tomorrow's date and display the results.Use structures
for today's date,tomorrow's date and an array to hold the
days for each month of the year.
Answer / Honey Agarwal
```cn#include <stdio.h>nnstruct Date {n int day;n int month;n int year;n};nnconst int daysInMonth[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};nnvoid getDates(struct Date *today, struct Date *tomorrow) {n printf("Enter today's date (dd mm yyyy): ");n scanf("%d %d %d", &today->day, &today->month, &today->year);n tomorrow->day = today->day + 1;nn if (tomorrow->month == 1 && tomorrow->day > daysInMonth[0]) {n tomorrow->month = 2;n tomorrow->day -= daysInMonth[0];n }n else if (tomorrow->month > 12) {n tomorrow->year++;n tomorrow->month -= 12;n }n}nnvoid displayDate(struct Date date) {n printf("%d/%d/%dn", date.day, date->month, date->year);n}nnint main() {n struct Date today, tomorrow;n getDates(&today, &tomorrow);n printf("Today's date is:");n displayDate(today);n printf("Tomorrow's date is:");n displayDate(tomorrow);n return 0;n}n```
| Is This Answer Correct ? | 0 Yes | 0 No |
Differentiate between #include<...> and #include '...'
how to get the starting address of file stored in harddisk through 'C'program.
A stack can be implemented only using array?if not what is used?
Explain how do you convert strings to numbers in c?
What is the purpose of type declarations?
write a program to read a number and print in words that is in sentence for example 21,219 then output is "twenty one thousand and two hundred nineteen" by using only control flow statements (only loops and switch case )?
What is the difference between text and binary modes?
enum DAY { sunday, monday, tuesday }; enum EDAYS { friday, saturday, sunday }; void main() { int i =0; if( i == sunday) { printf("%d",i); } } what would be the output?
can we store values and addresses in the same array? explain
Write a C++ program to generate 10 integer numbers between - 1000 and 1000, then store the summation of the odd positive numbers in variable call it sum_pos, then find the maximum digit in this variable regardless of its digits length.
Explain what is the general form of a c program?
what is the code for getting the output as * ** ***