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)
4 Respuestas
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;
}