Program to compare the two dates given by the user, C/C++ Programming

Assignment Help:


 THIS PROGRAM IS TO COMPARE THE TWO DATES GIVEN BY THE USER



#include
#include
#include

struct date
 {
  int dd;
  int mm;
  int yy;
 };

date compare(date d1,date d2)
 {
  if (d1.dd   {
   cout<<" 2nd date day is bigger ";
   }
   else if(d2.dd   {
   cout<<" 1nd date day is bigger ";
   }
   else if(d1.dd==d2.dd)
   {
    cout<<" ";
   }
  if (d1.mm   {
   cout<<" 2nd month is bigger ";
   }
  else
   {
   cout<<" 1nd month day is bigger ";
   }
  if(d1.yy>d2.yy)
   {
   cout<<" 1st date is bigger " ;
   }
  else if (d1.dd==d2.dd && d1.mm==d2.mm && d1.yy==d2.yy );
   {
   cout<<" the dates are equal ";
   }
  if(d2.yy>d1.yy)
   {
   cout<<" 2nd date is bigger ";
   }
 }


void main()
  {
  clrscr();
  date d1,d2,ans;
  cout<<" enter the 1st date (dd/mm/yyyy) ";
  cin>>d1.dd;
  cin>>d1.mm;
  cin>>d1.yy;
  cout<<" enter the 2nd date (dd/mm/yyyy) ";
  cin>>d2.dd;
  cin>>d2.mm;
  cin>>d2.yy;
  compare(d1,d2);
  }












Related Discussions:- Program to compare the two dates given by the user

Lcm code, full coding for lcm in c++

full coding for lcm in c++

Write a program to find the area under the curve y =, Write a program to fi...

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b.   #include float start_poin

Structure, railway reservation programming

railway reservation programming

Assyrian keyboard for android, Project Description: I want an app that t...

Project Description: I want an app that the user can download it from the play store and use it as a keyboard for texts and writing. Just like the Samsung keyboard and the arabi

Program of sorting algorithms , The program sorting.cpp contains a main f...

The program sorting.cpp contains a main function for testing the operation of several sort algorithms over various data sizes and data set organisations. The program understands

C program to print l diagonal triangle, C program to print L diagonal trian...

C program to print L diagonal triangle: void main() {                 int i=0,j=0;                 int arr[rows][cols];                 for (i=0; i

Introduction of computer and programming concept, Classify computer system ...

Classify computer system according to capacity. How they are different from computers according to the classification of technology. Provide comparative study also.

Wap to print the largest number from any 10 numbers, WAP TO PRINT THE LARGE...

WAP TO PRINT THE LARGEST NUMBER FROM ANY 10 NUMBERS #include stdio.h> #include conio.h>   void main()   {                    int a[10],i,max;

Pointer declaration for data member, P o i n t e r d e ...

P o i n t e r d e c l a r a t i o n f o r d a t a m e m b e r : M e t h o d 1 : i n t M : : * p x ; / / T h i s

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd