0
Need help with this problem!
Write two scanf statements to get input values into birthMonth and birthYear. Then write a statement to output the month, a slash and the year. End with newline. The program will be tested with inputs 1 2000 and then with inputs 5 1950. Ex: if the input is 1 2000, the output is 1/2000 Note: The input values come from user input, so be sure to use scanf statement, as in scanf(â%dâ, &birthMonth), to get those input values( and donât assign values directly, as in birthMonth=1)
3 Answers
0
#include <stdio.h>
Int main(void) {
Int birthMonth;
Int birthYear;
Scanf (â%dâ, &birthMonth);
Scanf(â%dâ, &birthYear);
Printf(â%dâ, birthMonth);
Printf(â%dâ, birthYear);
return 0;
}
My output is 12000 instead of 1/2000
0
#include <stdio.h>
Int main(void) {
Int birthMonth;
Int birthYear;
scanf (â%dâ, &birthMonth);
scanf(â%dâ, &birthYear);
printf(â%d/%dâ, birthMonth, birthYear);
return 0;
}
0
#include <stdio.h>
int main(void) {
int birthMonth;
int birthYear;
scanf("%d", &birthMonth);
scanf("%d", &birthYear);
printf("%d", birthMonth);
printf("/%d\n", birthyear);
return 0;
}