Answer to Question #265558 in C++ for Usama

Question #265558

Create a structure a type date that contains three members: the day, the month, the year, all of type int. Here the user enter a date in the format 10/9/2007, store it in a variable of type date, then retrieve the value from the variable and print the mouth in the same format.


1
Expert's answer
2021-11-21T04:55:22-0500
#include <stdio.h>


struct date
{
  int month;
  int day;
  int year;
};


int main ()
{
 
  struct date D;
 
  printf ("Enter month (in format :10/9/2007) : ");
  scanf ("%d/%d/%d", &D.month,&D.day,&D.year);
  printf("The Entered Date is : %d/%d/%d",D.month,D.day,D.year);
 
  return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS