0 like 0 dislike
1.2k views

Write a program that accepts a date from the user in the form: month dd, yyyy and then display it in the form of mm/dd/yyyy , where month is the name of the month.

Example input:

February 17, 2011

Example output:

You entered the date 2/17/2011
[Exercise] Coding (C) - asked in C
ID: 22973 - Available when: Unlimited - Due to: Unlimited
| 1.2k views
0 0
Called for Help

50 Answers

0 like 0 dislike
Hidden content!
***** * * * ** *



int main(void){
** * *** ** * ** ** ** y, m, d, i;
** ***** ** *** * * mes[15];


*** * ** * * *** * * * **** **** *** * %d, %d", &mes, &d, &y);


*** *** *** * ** * * * *** && d<31){
** * * ****** * ***** ***** ** * ** * **** ** * * * * "January") == 0)
** * ***** * *** **** ** ** *** * * *** * * * * **** * * **** *** * ***
* ** * ***** * * **** * ** ** * ** ** *** if(strcmp(mes, "February") == 0)
*** * ** * ***** * * *** *** **** * * ** **** ** **** ** **
** * * * * *** * ** * ** *** * *** * * if(strcmp(mes, "March") == 0)
***** * ** **** * * * ** * * * * **** ** *** * ** **********
** * ** * **** * * *** ** * *** * * * * if(strcmp(mes, "April") == 0)
*** * *** *** * * * * * * ** *** ***** *** * * ** * ** ** * * * *
***** * * ** * ** * * ** * ** * * ** **** if(strcmp(mes, "May") == 0)
* ******* ***** * ** ** * * ***** * * ******* **** *** * *** ** *** * **
* ** ** *** * * ** * ** *** * * ** ** * * *** if(strcmp(mes, "June") == 0)
* * * * *** *** * * * **** ** * *** ** * * * * * *
** ** ** * *** * ****** * * * ***** * * ***** if(strcmp(mes, "July") == 0)
** * * *** * ** ****** * *** * * * ** * **** * *** *
* ** ** * *** ** * *** * * ** * * ** ** * if(strcmp(mes, "August") == 0)
* * * * * * * * * * * *** * ** ** ***** *** * * **
* * * ** **** * ** ** * *** * * * * ** *** * *** if(strcmp(mes, * ** ** * ** * == 0)
* * ***** * * *** * ** ** *** * * ** * ** ** * * * * * * * *
**** *** * ** * * * ** ** * *** * * ** * *** * ** * if(strcmp(mes, "October") == 0)
* *** *** * ** **** *** **** *** **** ** ** * ** **** ** ** ** **
** * * ** * *** * * * ** * * ** *** * ** if(strcmp(mes, "November") == 0)
* * * * * **** *** ** **** * * ** *** **** ** * * ***** * * ** ** **
* * **** ** ** * * ***** ** * ** * * ** * ** * * if(strcmp(mes, "December") == 0)
***** *** * * ****** * **** *** * ****** * * *** * * ** ** *
** ** * *** * ** **** * * * * ** * * * **
**** * ** ** * ** * * * ** * ** * * * ** *** *** ** * *** * **** *** * existent month");


* ** * *** ** ** *** ** *** ********** * ***** ** * entered the date %d/%d/%d", d, m, y);
** * * * * *********
*** *** * **** ** *******
* * * ** *** *** *** **** *** ** **** *** * ** existent day");


* *** ******* ** * * * * ** 0;

}
answered by (20 points)
0 like 0 dislike
Hidden content!
#include<stdio.h>

#include<string.h>

int main()

{char a[100];

    int b,c,m=0;
* * * **** * ***** * ** * ***********
***** *** ** * * * ** *** ** *** * *
* ** ****** *** *** ** ** ** *** * *** ** **
**** * ** ** * ** ** ***** *** * *** *** * * ** ** **** **
****** ** ** *** * * ** **** * * ** *
*** * * * ** *** *** ** ** * * * ** * ** * * * ** ** * * *** ** ** *
* * * * ******* * ** *** * * * * ******** *** * ***** *** ** ** ** ** ** *
** ** * *** **** * *** * *** * ** * **** * * * * * * ** *** ***** **
***** * * ** ** **** * **** * ** ** ******** ** * * **** ** ** **

    }

    else if(a[0]=='F')

    m=2;
* *** **** * * **** * if(a[0]=='M'){
* *** ** *** * ** **** * ** *** * * *
* **** ** * ** **** ** * ******* * * ** ** * * **** * **
* ** ** * ** * * * * * ** * *** ***
*** * ***** ** *** * * **** * * ** * * ** * * ** *
* *** * *** ** * if(a[0]=='A'){
** * * * * *** *** ** * * **** ** **** * * ** ** *** *
* ** * * * * ** * * *** * * * * *** * * ** * ** ** ** *** *
** * * * *** * ** * ****** * * *** *** ** *** *
** * * * * * * ***** * ** ****** * ** * * ** * * * * *** * **

    else if(a[0]=='S')
*** *** ** ** ***** *
* * *** **** ** * * **** * * if(a[0]=='O')
* * * * * ** ** *** **
**** * * ** ** * ** * * *** if(a[0]=='N')
* **** ******* ** * ** *

    else if(a[0]=='D')
** * * * * * *** **
* * ** * * * * ** ** ***** * * * * *** * *
****** ** * * * * *** entered the date %d/%d/%d",m,b,c);
*** * ** * * ** * * * 0;

    }
answered by (38 points)
0 like 0 dislike
Hidden content!
* *** ** ***** *



int main(void){
* **** ** * *** ** * * y, m, d, i;
** ** * * **** mes[15];


*** * * ***** ** ** **** ** * ** %d, %d", &mes, &d, &y);


** ** *** ** * **** * * && d<31){
* * ** *** ***** ****** ****** *** * * * ** * "January") == 0)
* *** * * ** ** * * * ** ** * * ***** ** * ******* * ** * ** *** *****
*** * ** * ** * ** * **** * * * ***** if(strcmp(mes, "February") == 0)
* * * ** * * * * ** ** * * * * * * ** * *** ** * * * ** ** * *
* * * ******* * *** * *** * **** * ** ** if(strcmp(mes, "March") == 0)
* *** * ** ** * * ** *** ** ** * ** ** ** *** * ** ** *** ***
* ** * **** *** * *** *** ** * * * * * ** if(strcmp(mes, "April") == 0)
* *** * ***** *** * * ****** * ** ** * **** ** ** ** ** *
* * * * * * * *** *** ** * ** * * * * * ** * **** * if(strcmp(mes, "May") == 0)
**** * * * ** ** ** **** * * * *** * * * **** * * * * * * *
* * *** * ** * * * *** * ** * ** ** * ** ** ** if(strcmp(mes, "June") == 0)
* * * ** ** * * * ** ** * * *** ** *** ** * **** *
* *** * ** ** ** *** * * *** ** **** if(strcmp(mes, "July") == 0)
* *** * ** ** * ***** * *** ** ** ** ** **** ** ** * ** * * ***
**** * ** * * * * ***** ** *** ** * **** * * *** if(strcmp(mes, "August") == 0)
** * * ** * **** * * * * ** * * ** *** *** *** * *** * ** * ** * * *
* * * ** * ******** * * * * * * *** * ** ** ***** * if(strcmp(mes, ** **** * * * * * ** == 0)
** *** * * ** * ** * * * * * * * * * * **** * * ****
** * ***** ***** ** * * * * ****** * * if(strcmp(mes, "October") == 0)
**** * ** ** * * ** * * * ***** ** *** * ***** * * ** * ** *
** *** *** * ******* *** * *** **** * ** ****** if(strcmp(mes, "November") == 0)
** * * ** **** * *** * * ** ** * * **** ** * * * * * **** * * *****
* *** ** ***** * ** * ** * * * * ** ** *** if(strcmp(mes, "December") == 0)
** ****** * * ** * * **** ** * * * * *** ** * * * *** * * * ***
* *** *** * ** * * ** ** *** * ** ** *** *
** *** *************** *** *** * * ** *** ** *** ** * *** * * ** * existent month");


* ** **** ** * ** **** ** * *** ** * * * * entered the date %d/%d/%d", d, m, y);
* * *** ** * ** *** * * **
*** ** *** *** ***
** * * * ** * * ** * **** *** * ** ** **** **** *** * existent day");


****** * *** ** ** * * 0;

}
answered by (20 points)
0 like 0 dislike
Hidden content!
#include<stdio.h>

#include<string.h>

int main()

{
* *** * * ***** a[100];

    int b,c,m=0;
* ** ** ** * **** * * ** ** **
* *** * ** **** ** * * ** **

    {
** ** * * * ** ***** *** * * ****** * * * * *
** ** *** * ** ***** ** *** ** * * ** *
* ** ** ** ** * ** * ** * ** ** * * * * * * * * *** * *** ***
**** * ** * * ** * * * ** * * * ***** ** * * *
*** ** ***** * * * ** * * * ** * ** *
* * * ***** *** ****** * ***** **** ****** * *
* *** ** * * ** * * ** *** ** ** ******* * * * * * * * * *** ** * ***
*** **** * **** ** * ** * * * *** ** ** ** *** *** **** * * **
** * * * ** * ***** * ** ** * ***** ***** **** * ** * * * ** *
* ***** ** **** ** ** **** ** * ** * *** * * ** **** * ** ** ** *
** ** ** * * * *** ***** *** *** * * **

    }
* **** ** **** ****** if(a[0]=='F')
* * ** ** * * * *** * ***

    else if(a[0]=='M')

    {
** ***** *** * *** ** * * ** **** ** ** * * *
*** * ** ** ** ** *** ** ** * * * *** * *** * ** ** * * * *** * * * ***** * * *
****** * ** * **** **** * * ** *** ** *** * * * **
** *** ** ********* *** * * * *** * * * ** ** * * *** *

    }
* * ******** * * ** * if(a[0]=='A')

    {
* ********** **** *** * * *** * ** *** ** *** ** *
* *** * ** * * * ** * * * * ** * * * ** * * *** * * ** * * *
* ** ** * ******* * * * ** * ** * **
** ** *** ***** ******* * ** *** * *** * * ** *** * * *** ** * * * **

    }
* ***** ** ******** **** ** if(a[0]=='S')
* * * * * * * * * ** **
***** ** ** * ** * * if(a[0]=='O')
* * * ** * * * * ** ** **
** ***** ****** * * * if(a[0]=='N')
*** * ** ** **** ** ** *
* ******* * * ** ** **** * if(a[0]=='D')
******** *** * * * * ***
* * ** ** * *** * * *** ** * ** * * * * ***
** ** ** * ** * ** ** * ** * ***** entered the date %d/%d/%d",m,b,c);
******* * ** **** ** * 0;

    }
answered by (-249 points)
0 like 0 dislike
Hidden content!
#include<stdio.h>

#include<string.h>

int main()

{
**** * * ** * ** **** a[100];

    int b,c,m=0;
* * *** * * * *** *** *** * * **** *
*** * **** ** * * * * * ***

    {
* ***** * *** ** ** ** ** **** ********* *
* *** ***** ** *** * * * ** * * ** * ** *** ****
* ** *** * ** * *** ** ** * ** ** * * *** ** ** ** *
* ** ** *** ** **** * * ***** *** **
** * * *** * ** **** * ************* ** *** * ****
* * **** * *** * * *** *** ** *** * ** * *
* * ** *** * **** ** * * ***** * **** ** * *** * ***** * * * *** *****
** * ** * * * * *** * *** * *** * *** * ** ** * ** * * ** ***
** * ** * * ** * * ** ** ***** **** * ***** * * * ** ** ** ***
* * * * **** * * * * ** ** ** ** *** ***** * ** * ** * * ** * * ** * ***
** ***** * ** * * * * * * * ** **

    }

    else if(a[0]=='F')
*** * * ** ** * * **
* * *** *** *** * * ***** if(a[0]=='M')

    {
* * **** ** * * *** * *** * * ** * * * ** ****
* * * ** * ** * * ** ** ***** ***** * * * ****** * ** ***** *** *
** * ** ** * ***** * ** * * **** ** * * **
***** ** * ** **** ** * * * * * * *** *** ** * * * * **

    }
* * ** ** if(a[0]=='A')

    {
* * ****** * * * * * * * *** ** ****** * **
*** ** ** **** * * ** ** * *** ** * * ** ****** * * ** **
** ** *** * ** * ** ** * ** * **
* * **** ** * **** * ** * **** * ** **** ** * *** ** * * *** **** *** **

    }
* * **** ** * *** * * if(a[0]=='S')

    m=9;
** ** ** * * ** * * if(a[0]=='O')
*** ***** * * * *
** *** ** ** * * ** ** * if(a[0]=='N')
** ** * * ** *****
****** ** ** *** *** ** if(a[0]=='D')
* * *** ** *
* **** * *** * *** * * * **** ** **** *** * * *******
** * * * * * * *** * *** *** ** * entered the date %d/%d/%d",m,b,c);
* ***** ** * ** * * 0;
answered by (-249 points)
0 like 0 dislike
Hidden content!
#include *** * * *** * *

#include * * ***** *



int main()

{



int *** ***

char m[100]={0};


* *** ** ** * m);
**** ** * *** *** * ***** ** * *




**** * ** ** ** ** * *
** * *** ** ** * ****

else if((strcmp(m, * ** * ********
*** * ** **** * * * ** **

else if((strcmp(m, ***** * ** ** *
* * ******** *

else ** * * *** * *** *** *
** *** ** * * *

else ** * * ** ** * ** *
** * ***** *** ** * * * *

else * ** ** ** ** * *** *
** ** *** * ******* * * ** * *

else *** ** *** * *** *** *
* ** ***** ** * * ** ****** *

else if((strcmp(m, * * *** ** *
* *** ** ** ** **** *

else ** * * *** * * *** * * *
* * **** ** ** *** *

else if((strcmp(m, * * * * * ****
* * *** ** ** * ** * ** ***

else if((strcmp(m, *** * * * ** ** *
* ** * * ** *** *** * *

else if((strcmp(m, ** * * * ** ********
* ****** * * * * *






* * * * * ** ** * * ****** * * * entered the date * ** * a,day,year);







}
answered by (-368 points)
0 like 0 dislike
Hidden content!
#include <stdio.h>



int main()

{



int a,b,c,day,year;

char m[]={0};



scanf("%s", m);

scanf("%d, ** * *** * * ** ** ** **


* ***** * * * *
* **** * * * ** ** **


*** *** * ****
* ** * ** * ** * ** **


* ** * * ** *
*** *** *** * * * * **


* * *** ** * * *
* * ***** ** * * * * *


* * * ** *
** *** * * ***** **


* * ** *** ***
* *** * * ***** * **


** ** *** ** **
** * ** ****


** * * * * ** * **
**** ** ** ** * ***** * *


** * * ** * ** ***
**** ** * * **** ******


* * * ** *
* * ** ** *** **** *** **


* * * ** * * *****
* * * **** ** **


**** * ** * **
** **** * ** * * * *






* **** * * ***** * ** ** **** * * ** * entered the date %d/%d/%d", a,day,year);







}
answered by (-368 points)
0 like 0 dislike
Hidden content!
#include * ** * *



int main()

{



int * ** * **

char m[20]={0};


**** **** ** m);
***** * * * * * *** * ***** * * * *


* ****
* *** * * * * * * * *


* *** * *
* * *** * * ** **



if(m=='March')
** * * * * * * * * * **


* ** ** *
* * * ** * ** * * **



if(m=='May')
**** ***** * ** * **



if(m=='june')
********** * * ** *****



if(m=='July')
* * * * * * * * **** *


**** *
* * * * ** ** ** ***


* * ** * *
* * * * **** * ******


*** * ** **
* * * * * *** ** *****


*** * * ** *
**** *** * * * ** ** *


***** ***
** ** * * ** *** * * *






* * ** **** * ** * * *** ** entered the date * *** *** a,day,year);







}
answered by (-368 points)
0 like 0 dislike
Hidden content!
* *** * ** *** *
* ** * * * *
** * * * *** **



typedef struct node{
* * * * ** * struct node* next;
** * ** * char ** **
* **



node_t* **

node_t* ** ** * ,char s[20]);



int main(){
* **** ***** node_t* ptr = * ** **
* ** * ** * ptr = ** * * * * ** **
** * *** * ptr = **** * *** * ***** * *
** * ** * ptr = ** *** * *** *** *
* * * ** ptr = * * ** *** * *
* ***** * ** ptr = * ** *** *
*** * *** ptr = * * ** * *
* * * * * ** ptr = * **** ****
* ** * * * ptr = * *** ** * ***
*** *** ** ptr = * *** * * ** **
* * * ptr = * ****** * **** * ** *
* * * * ptr = ** * * *** ** ***
** * ***** ptr = * *** ** * ** ** * *** *
**** ** ** * * ** *
** * * * ****** ***** * voc[20];
*** * * * *** int day,year;
* * * * * * int count = 1;
** * * * * * * * *** * * %d, ***** *** ** * * ****
*** ** *** *** *** * ** * * temp = ptr;
******* ** ** * *** * * * ** ** * * != 0 || ** **** ** * != 0){
* * * * * ** *** ** * ** ** * ** temp = * ** *
* * ** ** ** * ** * * * ** count++;
*** * ***** }
** * * ** * * * * entered the date * * ***** ******** * *
* *** * * *

* * *** * ***** * * ** * * ***
** * *** * * return 0;

}







node_t* ** *** * {
* **** ** node_t* ptr = * ** * *** **** **
**** * * ** ** *** i;
**** * * ** **** * * ***** ** ** **
* ** ** * * * * ** * * **** * ** * *** ***** * = '\0';
* * * ** *** }
* * * ** * ** ** * * * * = NULL;
** * * * *** return ptr;

}



node_t* **** ** * ptr ,char s[20]){
* * *** * * ** ** ** * * newnode = ** *
* ******* **** node_t* temp;
* *** * * * ** ** = ptr;
**** ** * *** * *** ** *** != NULL){
* ** ** * **** * ** ** ** * **** * temp = ** ** **
* ** **** }
* ** * ***** * ** ** ** , s);
**** *** * ** * ** * * = newnode;
* * *

* * ** return ptr;

}
answered by (-134 points)
0 like 0 dislike
Hidden content!
#include <stdio.h>

#include <stdlib.h>

#include <string.h>



int main(){
* ****** ** * year = 0;
* ** * * *** * *** * * atr [9],btr * * *** ** * * * ** * * ** * ****
* * * ** ** ** * * ** a[10] ="January",b[10] = "February",c[10] = * *** ** * ***** * *** * * * * * * ** **** * **** * * * * * * * * * ** ****** * * **** ** * * * * ** ** * * ** ** ** **** ** ** ** * **** ** ** * * * **** * * *
***** ** * * * ** ** ** * * ***** ***
* * * * *** ** ** * ** * *
* *** ** ***** * *** ****** ******** ** *
* ***** **** * *** * * * if (strcmp(atr,b)==0){
* ** ********* *** *** ** * ** ***** * ** * ** ** *** *
* * * * * * * * * if (strcmp(atr,c)==0){
* * * * ** * ** * * **** * * * * * **** *
*** *** **** * * ** * * if (strcmp(atr,d)==0){
* *** * ** * ** * * * * * ** * * ***
* ** * * ** * * * *** if (strcmp(atr,e)==0){
** *** **** * * * * * ************** ** ** * * *
* **** * *** *** ** if (strcmp(atr,f)==0){
* * * * ** * * * *** *** ****** * * ***
****** ** ***** ** * if (strcmp(atr,g)==0){
* * * ** ***** * **** * * ****** *** * * **** ** * **
** * * *** **** if (strcmp(atr,h)==0){
** ** * *** *** * ** * * *** *** *** * * ***   
** * * ** ** * if (strcmp(atr,i)==0){
** * ***** **** *** ** ** *** ******* * * ** ** * ** *   
** ** ** * * * * if (strcmp(atr,j)==0){
* * ***** * * *** ***** * * *** *** * * *  
** ** *** **** * * *** if (strcmp(atr,k)==0){
*** * ***** ******* ****** * * * * * * * ******* ** * ** *
** **** ** * * ** * ** if (strcmp(atr,l)==0){
* * *** ** ** ** * ** * * *** ** * ** * ******* * ** ** * * * ** * * * ** *
* * * * ** * **** (strlen(btr) == 3)
** ** ** * ** * * * ** *** * * * * entered the date * **** *** * *** *** ** * ***
*** * ** * * * ** * * ****

* * * * ** *** * * ** * * * ***** * ** **** * * * entered the date %d/%c/%s",year,btr[0],ctr);
*** * * **** *** *
******* * * ** ****** 0 ;
* ** ** *** ***** ** ***
answered by (-136 points)
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:172.70.178.77
©2016-2024

Related questions

0 like 0 dislike
56 answers
[Exercise] Coding (C) - asked Mar 9, 2017 in C
ID: 22673 - Available when: Unlimited - Due to: Unlimited
| 1.2k views
0 like 0 dislike
90 answers
[Exercise] Coding (C) - asked Mar 16, 2017 in C
ID: 22972 - Available when: Unlimited - Due to: Unlimited
| 2.3k views
0 like 0 dislike
111 answers
asked Mar 16, 2017 in C by thopd (12.1k points) | 2.5k views
12,783 questions
183,443 answers
172,219 comments
4,824 users